activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Sending Async messages to temp queue really slow
Date Mon, 19 Feb 2007 10:15:18 GMT
On 2/17/07, Paul French <paul.french@frenchiesystems.com> wrote:
> 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.

BTW why is the server single threaded? Why not create a bunch of
sessions & listeners.

> 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 =
> connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
>         consumer = session.createConsumer(mainQueueName);
>         connection.start();
>
> In the appropriate place the following gets called
>
>           jmsRequest = consumer.receive();
>           jmsRequest.acknowledge();
>
>
> The server produces messages by creating another connection, a session and a
> single producer.

Why? Thats gonna be very slow. Why not just reuse the same session
that you are using for consuming and just cache a MessageProducer you
can use for sending (and do async sends)

-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message