camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Camel Router is blocked when waiting for response
Date Wed, 09 Jul 2008 14:25:21 GMT
2008/7/8 S.R. <>:
> 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...


Open Source Integration

View raw message