You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by PJ Walstroem <wa...@hotmail.com> on 2013/04/25 07:35:12 UTC

InOut and JMS topic, does it make sense?

hello,
we are using Camel 2.11.0 with the following route

from("activemq:incoming").inOut("activemq:topic:integrations").to("direct:storage").end()

my question is simply if this makes sense? We love the idea of using InOut
MEP and letting Camel generate temporary reply-queues. We have e.g. 10 JMS
Clients listening to the topic and all of them would like to send a reply,
but seems like Camel only handles the _first_ reply with the given
JmsCorrelationId, the following messages are just discarded and we get the
following error:

"Reply received for unknown correlationID
[Camel-ID-local-finn-no-60071-1366820228380-0-8]. The message will be
ignored"

Should we use inOnly instead? We use InOut to be able to preserve the
breadcrumb-id which we use for MDC logging (which Camel handles beautifully,
btw), but I guess we could just set that breadcrumb-id manually in a
postProcessor at the JMS Client side.

any thoughts would be highly appreciated!

regards,
Per Jorgen



--
View this message in context: http://camel.465427.n5.nabble.com/InOut-and-JMS-topic-does-it-make-sense-tp5731502.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: InOut and JMS topic, does it make sense?

Posted by PJ Walstroem <wa...@hotmail.com>.
thank you, Stephan. Your answer makes sense. I think we will use topic +
inOnly and handle the responses in a different route. The number of
subscribers could be as high as 50, so a topic seems to be the solution.

You also say that "Camel had no way to determine what n is and how many
answers to expect". I posted a question on that in a separate mail
(http://camel.465427.n5.nabble.com/Register-client-when-connecting-to-a-topic-tp5731504.html).
I would love to be able to determine n. Is it not possible at all?

cheers,
pj



--
View this message in context: http://camel.465427.n5.nabble.com/InOut-and-JMS-topic-does-it-make-sense-tp5731502p5731505.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: InOut and JMS topic, does it make sense?

Posted by "Siano, Stephan" <st...@sap.com>.
Hi,

>From my understanding Request Reply (InOut) doesn't make too much sense in combination with topics. With queues the semantic is simple: you send out a message to a queue, wait for a response in a different queue and proceed. For topics the  thing is a bit different, if you send a message to a topic, this is more an Event Message (InOnly) as there may be an arbitrary number of consumers (0..n), so even if there were responses for these messages, Camel had no way to determine what n is and how many answers to expect.

For your use case, I see two different approaches you could take: Either continue to use a topic (but with InOnly) and handle the responses in a different route (as you proposed in your mail) or use a multicast to send this to 10 queues (instead of a topic) with the InOut pattern and then aggregate the responses (Scatter-Gather EIP).

Best regards
Stephan

-----Original Message-----
From: PJ Walstroem [mailto:walstrom@hotmail.com] 
Sent: Donnerstag, 25. April 2013 07:35
To: users@camel.apache.org
Subject: InOut and JMS topic, does it make sense?

hello,
we are using Camel 2.11.0 with the following route

from("activemq:incoming").inOut("activemq:topic:integrations").to("direct:storage").end()

my question is simply if this makes sense? We love the idea of using InOut
MEP and letting Camel generate temporary reply-queues. We have e.g. 10 JMS
Clients listening to the topic and all of them would like to send a reply,
but seems like Camel only handles the _first_ reply with the given
JmsCorrelationId, the following messages are just discarded and we get the
following error:

"Reply received for unknown correlationID
[Camel-ID-local-finn-no-60071-1366820228380-0-8]. The message will be
ignored"

Should we use inOnly instead? We use InOut to be able to preserve the
breadcrumb-id which we use for MDC logging (which Camel handles beautifully,
btw), but I guess we could just set that breadcrumb-id manually in a
postProcessor at the JMS Client side.

any thoughts would be highly appreciated!

regards,
Per Jorgen



--
View this message in context: http://camel.465427.n5.nabble.com/InOut-and-JMS-topic-does-it-make-sense-tp5731502.html
Sent from the Camel - Users mailing list archive at Nabble.com.