You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dharini <dh...@polarisft.com> on 2013/11/14 07:42:10 UTC
JMS acknowledgement message to calling endpoint
I am trying to send back a acknowledgement from a JMS queue. Below is my line
of code.
context = new DefaultCamelContext();
ConnectionFactory connectionFactory =
new ActiveMQConnectionFactory(
"vm://localhost?broker.persistent=false" );
context.addComponent( "test-jms",
JmsComponent.jmsComponentAutoAcknowledge( connectionFactory ) );
context.addRoutes(new RouteBuilder() {
public void configure() {
from("mina:tcp://localhost:6789?textline=true&sync=true")
.to("test-jms:queue:test.queue") }
});
context.start();
Thread.sleep(10000000);
context.stop();
Kindly suggest me where I need to add the logic and is there any flag
available for this.
--
View this message in context: http://camel.465427.n5.nabble.com/JMS-acknowledgement-message-to-calling-endpoint-tp5743234.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JMS acknowledgement message to calling endpoint
Posted by Claus Ibsen <cl...@gmail.com>.
Do you mean you need to send some kind of ack back from the mina consumer?
Also mind about InOnly or InOut over the JMS endpoint.
Since you have mina with sync=true, then the message exchange pattern
is InOut, which means request/reply over the JMS endpoint.
Is this what you want?
If not you need to set InOnly, so the message sent over JMS is InOnly
(fire and forget)
.to(ExchangePattern.InOnly, "test-jms:queue:test.queue")
You can see more details here
http://camel.apache.org/request-reply.html
And then you can do a message translation afterwards to set the
message to some kind of ACK to send back over the mina consumer
from mina
to jms
transform(constant("ACK"))
On Thu, Nov 14, 2013 at 7:42 AM, dharini
<dh...@polarisft.com> wrote:
> I am trying to send back a acknowledgement from a JMS queue. Below is my line
> of code.
>
> context = new DefaultCamelContext();
>
> ConnectionFactory connectionFactory =
> new ActiveMQConnectionFactory(
> "vm://localhost?broker.persistent=false" );
> context.addComponent( "test-jms",
> JmsComponent.jmsComponentAutoAcknowledge( connectionFactory ) );
>
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> from("mina:tcp://localhost:6789?textline=true&sync=true")
> .to("test-jms:queue:test.queue") }
>
> });
> context.start();
> Thread.sleep(10000000);
> context.stop();
>
> Kindly suggest me where I need to add the logic and is there any flag
> available for this.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/JMS-acknowledgement-message-to-calling-endpoint-tp5743234.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen