activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul French <>
Subject Sending Async messages to temp queue really slow
Date Sat, 17 Feb 2007 00:30:37 GMT

I am using the defualt install of activeMQ 4.1.0
I've turned off persistence and increased memory-manager setting to 500MB
I've also updated the startup script so that the java heap can increase to
1G of memory if required

The messaging layer of my app is simple. The client creates a temp queue on
the broker and then sends messages async to a named main queue where each
message has the JMS reply to set to the temp queue. 

The server consumes messages from the main queue does some processing and
then sends the resulting message to the temp queue. The client then consumes
the messages off the temp queue.

On the server consuming messages is fast. However sending the results back
to the temp queue is slow.

The server consumes messages by creating a single connection, a single
session and a single consumer. All of these objects are created on startup
and the consumer has the main queue set on it when created. e.g.

        connection = connectionFactory.createConnection();
        session =
        consumer = session.createConsumer(mainQueueName);

In the appropriate place the following gets called

          jmsRequest = consumer.receive();

The server produces messages by creating another connection, a session and a
single producer. All these objects are created on startup however the
producer has no queue set on it since it is not known until runtime. Hence
when the server sends a message back to the broker it calls

          producer.send(jmsRequest.getJmsReplyTo(), jmsResponse);

Now this is the major bottleneck in my application. Whereas the consumer can
consume 100 messages per second without breaking a sweat the producer is
only manage to send 50 a second back to the temp queue.

Is there any obvious things I can do to speed this up?

Why is it slow? Any ideas?

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

View raw message