On 7/10/07, Jim Alateras <[EMAIL PROTECTED]> 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.


--
James
-------
http://macstrac.blogspot.com/

Reply via email to