activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul French <>
Date Tue, 16 Jan 2007 13:57:52 GMT

Okay thanks.

Just for my understanding, why is it still super quick to send messages
using JmsTemplate (using Async and a SingleConnectionFactory) yet incredibly
slow to consume them (using SingleConnectionFactory)?

What is your recommended approach for consumming messages when using a
JmsTemplate in a standalone environment?

James.Strachan wrote:
> On 1/16/07, Paul French <> wrote:
>> I have read all this before a while back and thought I had covered
>> myself........
>> Let me re-iterate (please correct me if I am wrong)
>> On the server side for consuming messages I use the JmsTemplate. I resuse
>> the same connection. I suppose my question is the same as above, What is
>> the
>> cost of creating a session and consumer on the fly here?
> If you care about performance, never use JmsTemplate for consuming
> messages. Each time an attempt is made to receive a message a new
> connection, session, consumer is created. The broker will then start a
> new subscription up, start dispatching messages to it. On receiving
> one message, the JmsTemplate will then close down the consumer,
> session, connection.
> Basically the slowest possible way of consuming messages in JMS is via
> JmsTemplate - and the worst place to use this is the server when you
> care about performance
> -- 
> James
> -------

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message