Thanks for the insight and the quick response! I would think that many applications can tolerate out of order messages. Reponse ordering is anyways already out of the window when you enter the async requeste-response-space and the client needs to deal with that fact.
Ralf -----Original Message----- From: Claus Ibsen <[email protected]> Reply-to: [email protected] To: [email protected] Subject: Re: Can't get <camel:threads> to work Date: Wed, 5 Oct 2011 15:21:12 +0200 On Wed, Oct 5, 2011 at 2:59 PM, Ralf Steppacher <[email protected]> wrote: > I see. I will have to look into virtual topics for ActiveMQ then? > Or are there other ways to ensure that every route consumes a message on > a topic exactly once? I.e. a message is consumed by exactly one > (concurrent) consumer? > > Is this limitation of the JMS consumer going to be lifted in the nearer > future? > There is a JIRA ticket with a patch somewhere I was working on to allow JMS consumer to support async. https://issues.apache.org/jira/browse/CAMEL-3632 We may consider looking at this again. But the trick is to find a good way to configure it. by default IMHO, as it causes messages to possible not be processed in FIFO order. Eg being able to consume N+1 message, when N message is currently in-flight. > > Thanks! > Ralf > > > -----Original Message----- > From: Claus Ibsen <[email protected]> > Reply-to: [email protected] > To: [email protected] > Subject: Re: Can't get <camel:threads> to work > Date: Wed, 5 Oct 2011 13:05:12 +0200 > > The JMS consumer forces synchronization due the underlying Spring JMS > being used. > > You should enable concurrent consumers on the JMS endpoint to have > multiple consumers with JMS. > http://camel.apache.org/jms > > On Wed, Oct 5, 2011 at 12:16 PM, Ralf Steppacher > <[email protected]> wrote: >> Hi all, >> >> I am stuck with what seemed a trivial task: parallel execution of a >> route with <camel:threads>. >> >> I have basically copied the "Example: threads DSL" on >> http://camel.apache.org/async.html and tried the same in spring XML. >> This is what my route looks like at the moment: >> >> <camel:route> >> <camel:from ref="mq.topic.command" /> >> <camel:threads> >> <camel:unmarshal> >> <camel:serialization /> >> </camel:unmarshal> >> <camel:log loggingLevel="INFO" message="Received command: >> ${in.body}" /> >> <delay> >> <constant>10000</constant> >> </delay> >> </camel:threads> >> </camel:route> >> >> There are three commands published simultaneously to the topic >> "mq.topic.command" every minute. I expected the three commands to be >> logged quasi simsimultaneously due to the parallel processing, but it >> seems as if they are processed serially in a single thread: >> >> 2011-10-05 11:53:00,191 INFO route1 - Received command: Command >> [commandType=HARVEST_CLOSES, messageSource=EVENT_EMITTER, >> uuid=9497b5a2-8f39-435c-b00a-44135900d9b7, version=null] >> 2011-10-05 11:53:10,212 INFO route1 - Received command: Command >> [commandType=HARVEST_QUOTES, messageSource=EVENT_EMITTER, >> uuid=72018457-fa4b-4d0f-8187-9c7f8dabb0bf, version=null] >> 2011-10-05 11:53:20,231 INFO route1 - Received command: Command >> [commandType=HARVEST_TRADES, messageSource=EVENT_EMITTER, >> uuid=642227f5-0849-43fc-84f9-60233a6023a4, version=null] >> >> I have tried and tested all combinations of where to put the >> <camel:threads> tag, the behavior stays the same. >> >> I found several examples on the web that put the threads tag on a single >> line like this: <camel:threads /> >> This is valid according to the schema, but for me start-up of the route >> fails because "thread" has no children. >> >> I spent a little time debugging the ramp-up of the context and can see >> an ExecutorService being created. >> >> What am I missing? >> >> The behavior is the same with Camel 2.7.2 and 2.8.1. I am running this >> on Ubuntu 11.04 (64bit) and Sun JDK 1.6.0_26 (64bit). >> >> >> Thanks! >> Ralf >> > > > >
