camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Limit number of JMS messages when processing asynchronously
Date Tue, 08 Dec 2015 13:27:39 GMT
It depends a bit what you do with these messages in the Camel routes.

The jms consumer is in fact sequential by default (so if the routing
at some point becomes async, then it will wait for that inflight
message to complete before it consumes the next). But you can turn
that off with asyncConsumer=true, and if so the consumer will run as
fast as it can.

Using seda queues or other async components in the route all can have
an influence how it all flows.

Many of those jms settings is for tuning how the jms consumer react on
load, so it can scale up and down dending on how many of threads are
processing or idle, vs if there is no messages on the queue vs many
messages etc.

You can also use the throttler route policy

that can suspend/resume the routes depending on number of inflight messages.

On Tue, Dec 8, 2015 at 1:57 PM, jpeschke <> wrote:
> Hello all,
> We have a system consuming messages at a high rate from a JMS queue
> asynchronously and parallel. For Performance reasons, we have a very high
> idle timeout, so normally our camel-based software never reconnects to the
> broker and stays connected.
> The problem is that it seems that the asynchronous behaviour lets Camel take
> as many JMS messages as it can get, so sometimes we have thousands of
> inflight messages waiting to be processed. This is not such a big problem
> during normal operation, but when we shut down the system for maintenance,
> sometimes there are so many messages that they cannot be processed during a
> graceful shutdown.
> My question is: How can I specify how many messages camel takes out of the
> queue when using an asynchonrous consumer?
> I already defined
> - idleConsumerLimit
> - concurrentConsumers
> - maxConcurrentConsumers
> - maxMessagesPerTask
> but that doesn't seem to work (as far as I understand because these settings
> influence how many threads are used to get messages out of the queue but not
> how many messages may be "pumped" into the camel route)
> Any ides?
> Thank you & best regards,
> Joerg
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
----------------- @davsclaus
Camel in Action 2:

View raw message