Request / Response camel jms

I'm completely new to a camel, so excuse me if this is obvious.

We are trying to configure a camel route (in talend esb) that does the following:

  • receive message from jms
  • db update
  • send a message to another system using JMS using request / response
  • use the information in the response to perform another db update

It is all in one direction. I found out that the route no longer accepts messages at 1. While it is waiting for an answer at 3.

I tried using the "asyncConsumer" parameter on the JMS component, but that did not help.

How can I design a route so that it can process a second (or more) message while it is still waiting for a response of 3.?

Thank you Lachi

+4
source share
2 answers

The parameter described by Petter will help, but you will still block threads. Another approach is to develop integration as two separate routes. On the first route, you get a jms message, update db and send a second message.

If you use InOnly for the manufacturer of this route and set JMSReplyTo, as well as preserveMessageQuo = true, the camel will send a message, but does not wait for a response.

Then you use the second route, which listens for the response in the specified queue and performs the second db update. This way you are not blocking any threads.

+2
source

Use the concurrentConsumers attribute. This will allow multiple threads to handle your load. Please note that you need to specify the number of threads. This can be a bit complicated with all the parameters, so be sure to read the Camel JMS documentation.

Example from("jms:myQueue?concurrentConsumers=10")

You might want to specify concurrentConsumers in the response queue to respond to the request: .inOut().to("jms:requestQueue:foo?concurrentConsumers=10")

The last part Requires version 2.10.3 .

+1
source

All Articles