camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Camel Router is blocked when waiting for response
Date Wed, 09 Jul 2008 14:25:21 GMT
2008/7/8 S.R. <srassokhin@gmail.com>:
>
> For example, I have the following route:
>
> // main route
> from("jms:testQueue").to("jms:someOtherQueue");
>
> // and test consumer for "jms:someOtherQueue"
> from("jms:someOtherQueue").process(new Processor() {
>       public void process(Exchange exchange) throws Exception {
>                Thread.sleep(10000);
>                exchange.getOut().setBody("Reply");
>       }
> });
>
> It's easy to see that when we send request message (with JMSReplyTo field
> set) to the jms:testQueue, the Camel Router is blocked until reply from
> jms:someOtherQueue consumer is received, therefore new incoming messages
> can't be processed/routed during this time.
>
> Does Camel have some abilities or configuration settings to avoid this, and
> make this waiting asynchronous, so that other messages could be processed
> even if some of the previous messages hasn't been completely
> processed/routed yet?

As Claus mentioned, you can use concurrent consumers so that you can
process things in parallel.

Camel tries very hard to do the right thing using convention over
configuration; when using a JMSReplyTo address the common convention
is to send a reply back - hence the blocking. If you want to avoid
blocking and sending a reply back you can configure the JMS/ActiveMQ
endpoint to ignore the JMSReplyTo address and just send the message on
as a one-way message (so that it is the downstream endpoints issue to
deal with :)

See the disableReplyTo property - just set that to true...
http://activemq.apache.org/camel/jms.html

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message