activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Creating MessageConsumer overhead
Date Tue, 10 Jul 2007 14:49:58 GMT
On 7/10/07, Jim Alateras <> wrote:
> Just a general question about the overhead on creating MessageConsumer
> instances. Is it efficient to create MessageConsumers for relatively
> short conversations.
> For example a loop which basically checks for a message, executes a
> policy on the message and then sleeps for some interval. Would it be
> efficient to create a new MessageConsumer at the start of each iteration.

Its mostly a latency cost on the client side. There's some overhead;
particularly if the consumer is on a large queue using selectors with
filter most messages; as each new consumer created causes the broker
to iterate through all pending messages attempting to push them to the
new consumer.

So the faster approach will always to be to create consumers up front
and share them- then use say Message Groups to keep conversations
apart - but otherwise creating consumers for relatively short
conversations should be fine.


View raw message