We have a requirement where in I'll be deploying an application on n number of servers, say S1, S2 ,....Sn.There is an activeMQ queue defined on one of the servers , say S1.I have configured my servers to produce messages and place them in the same queue which is configured in S1. While all the servers are configured to use the same queue for storing the produced messages, my requirement is to have only one of the n servers process all the messages from the queue , again let's say S1.So while all the servers ranging from S1,S2,...Sn can produce and store them on the queue configured on S1,only S1 should process all of them.Hence I have disabled the "MessageListener" part of all the servers except S1. For some reason though, S1 doesn't process everything. I sense that the queue is distributing the messages in a round robin fashion in spite of the other Listeners being disabled. S1 processes every alternate message in a case where two servers are accessing a queue. Any help to resolve this issue would be greatly appreciated.
Note: If it might help,I'm using Spring JMS template and complete Spring XML based configuration for JMS.
Here is my XML configuration snippet
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://ipaddress:61617"/>
</bean>
<bean id="cscoDest" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="STOCKS.CSCO" />
</bean>
<!--The message listener-->
<bean id="portfolioListener" class="my.test.jms.Listener">
</bean>
<!--Spring DMLC-->
<bean id="cscoConsumer" class="org.springframework.jms.listener.DefaultMessageListenerContainer102">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="destination" ref="cscoDest" />
<property name="messageListener" ref="portfolioListener" />
</bean>
<!--Spring JMS Template-->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="stockPublisher" class="my.test.jms.SpringPublisher">
<property name="template" ref="jmsTemplate" />
<property name="destinations">
<list>
<ref local="cscoDest" />
</list>
</property>
</bean>
The above configuration is present in all of my servers.I'm disabling the 'portfolioListener' bean and it's property mapping in 'cscoConsumer' in all the servers except one which is S1 according to the above example.But still messages are being skipped in a round robin fashion.