1

I was looking for a functionality to stall the consumption of jms messages until a button click from ui. I use activemq for jms broker. And spring to create jms:listeners with a queue declared. However, the requirement is to stall the consumption of messages in onMessage() part of the MessageListener.

I have used receiveTimeout , after I changed the jms:listener in spring to defaultMessageListener as spring bean. Kindly advice.

1 Answers1

0

Believe you just need to control the listener and be able to stop/start programmatically, similar to this.

Community
  • 1
  • 1
Scott Sosna
  • 1,443
  • 1
  • 8
  • 8
  • the stop() functionality does not work properly. I tried a shutdown() , and it is not possible to restart once I do a shutdown. The stop() has the following code- synchronized (this.lifecycleMonitor) { this.running = false; this.lifecycleMonitor.notifyAll(); } which does not really affect the executeOngoingLoop() . Please suggest as it is in syncronized block. I am refering to DefaultMessageListenerContainer in spring. –  May 09 '16 at 14:41