Spring JMS with Websphere MQ Listener (Receiver or Subscriber)

This is the continuation Spring JMS with Websphere MQ

Step 1: Write a listener class to receive the message by invoking the onMessage(Message message) method.

Step 2 :  Configure the Spring container and bootstrap the MyListener  to the container. You can set up multiple consumers to run concurrently in multiple threads. This basically involves extending the class MyAppJmsTemplateConfig defined in part -2.

Refer to the myAppListenerContainer( ) method to bind the Spring listener container to the listener you defined earlier itself.

Step 3: Finally,the JUnit test class that waits for 10 minutes. In other words, waiting for the onMessage(…) method to be kicked off asynchronously when a message arrives on the queue.


800+ Java Interview Q&As Menu

Top