activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sitsky <>
Subject Embedded broker with TCP transport not message dispatching to all consumers in round-robin fashion
Date Tue, 31 Jul 2007 07:15:58 GMT

I am sure this is a silly configuration issue on my part, but I can't 
figure it out.

I am using activemq 4.1.1 on Vista.  I basically have two queues, one 
called submitted-items, and another called completed-items.

JVM1 takes items from completed-items, and does some work with them. 
This JVM also runs the embedded broker with a TCP connector.  I have a 
configurable number of sessions sharing the same connection which 
performs this work.

In JVM2, I have a worker process which take items from the 
submitted-items queue, and potentially generate new messages on both the 
submitted-items and completed-items queue.  There is also a configurable 
number of sessions sharing the same connection which performs this work.

This all works fine, regardless if JVM1 and JVM2 are on the same machine 
or not.

If I try to run JVM3, which runs the same code as JVM2, while I can see 
it connects to the broker (confirmed with debug), it receives no 
notifications for items on the submitted-items queue.

If I kill JVM2, then JVM3 immediately receives new message notifications.

If I start up JVM2 again, it sits there receiving no new messages.  If I 
kill JVM3, then JVM2 starts to receive messages again.

So connectivity works - but somehow during message dispatch, only one 
JVM (connection) is being selected for items in submitted-items queue.

I have set all prefetch limits to 1, and have created the broker as follows:

BrokerService broker = new BrokerService();

Connections for all JMS clients are created like:

ActiveMQConnectionFactory connectionFactory =
           new ActiveMQConnectionFactory(CONNECTION_URL);
ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
Connection connection = connectionFactory.createConnection();

All messages are received using the onMessage() style.

I know I probably haven't posted enough code - but is there an obvious 
reason why this might be happening?  Thanks in advance.


Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web:                            Fax: +61 2 9212 6902

View raw message