0

Do I have to use jetty embeded server to test my active mq structure in a Spring project? Any help would be appreciated.

javatar
  • 4,542
  • 14
  • 50
  • 67

2 Answers2

1

Please see the following links from ActiveMQ:

Community
  • 1
  • 1
Matthew Farwell
  • 60,889
  • 18
  • 128
  • 171
0

At first, add context your listener container bean like the following:

<bean id="sampleListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="concurrency" value="20-100"/>
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ref="sampleDestination"/>
    <property name="messageListener" ref="sampleListenerConsumer"/>
</bean>

Secondly,

DefaultMessageListenerContainer container = BeanProvider.getBeanFactory().getBean("sampleListenerContainer", DefaultMessageListenerContainer.class);
container.start();

Similarly,

container.stop();
javatar
  • 4,542
  • 14
  • 50
  • 67