Hey Mark
Thanks for the response. Here is how I am trying to achieve it ...
1. I set up a jms topic in our spring config (applicationContext-jms.xml).
<!-- ActiveMQ destinations to use -->
<amq:topic id="destination1" physicalName="${foo.topic.name}"/>
2. I set up the 2 listener beans
<bean id="queueListener1" class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class="foo.listeners.EventListenerJmsConsumer1"/> </constructor-arg>
<property name="defaultListenerMethod" value="receive"/>
<property name="messageConverter" ref="marshallingConverter"/>
</bean>
<bean id="queueListener" class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class="foo.listeners.EventListenerJmsConsumer"/>
</constructor-arg>
<property name="defaultListenerMethod" value="receive"/>
<property name="messageConverter" ref="marshallingConverter"/>
</bean>
3. I added a listener to the existing one ...
<jms:listener-container concurrency="10" >
<jms:listener id="QueueListener1" destination="${foo.topic.name}" ref="queueListener1" />
</jms:listener-container>
4. With the above done, I modified the EventListenerJmsProducer to accomodate
/**
* The JMS topic destination
*
* @param destination the destination to set
*/
public final void setDestinationtopic(
String destination){
this.destinationtopic = destination;
}
The corresponding entries were mapped in the applicationContext-eventlistener.xml
<bean name="eventClient" class="com.foo.event.listeners.EventListenerJmsProducer">
<property name="destinationtopic" value="${foo.topic.name}"/> modified
<property name="jmsTemplate" ref="jmsTemplate"/>
</bean>
5. When all this was done, I created a dummy event and the producer published it to the topic ...
jmsTemplate.convertAndSend(destinationtopic, event.getPayload());
6. As the final part of the
test, I caught the event published by the topic
Problem: I see either my consumer1 catching this event, or consumer2. In essence, I do not see a broadcast happening. Is there anything wrong I do here? Please let me know.