camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Is there a way to route to an HTTP Endpoint without blocking?
Date Wed, 09 Dec 2009 15:03:55 GMT
On Wed, Dec 9, 2009 at 3:42 PM, jweathers777 <johnweathers@gmail.com> wrote:
>
> I have a simple route that reads incoming mesages from a JMS queue, sends
> them to a webservice that hands back a response message that I then process
> and record:
> from("activemq:queueA").to("http://mywebservice").process(new
> DoSomething()).to("file://logs)
>
> Currently, if the web service times out, this route blocks and doesn't
> process other messages intended for the web service until the timeout period
> ends at which point the held back messages get processed.
>
> Is there a way to configure this route or a different kind of route to
> accomplish the goal of allowing messages to continue moving through to the
> web service even while one message is stilling being processed by the web
> service?
>
> I tried setting the MaxConnectionsPerHost to 5 as described under "Setting
> MaxConnectionsPerHost" here:
> http://camel.apache.org/http.html
>
> However, I still saw the blocking behavior after making these configuration
> changes.
> --

You can use concurrentConsumers=10 on the JMS endpoint which will give
you 10 threads at once for routing form the JMS queue.
This is probably the easiest.

In Camel 2.1 there is a new feature - toAsync
http://camel.apache.org/toasync.html

Which we will expand in the future but it does allow to use non
blocking request/reply.




> View this message in context: http://old.nabble.com/Is-there-a-way-to-route-to-an-HTTP-Endpoint-without-blocking--tp26711302p26711302.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message