I have requirement where I have to stop and start message consumer based on condition. If startConsumer flag is set true, then consumer should start consuming messages and if startConsumer is set to false then consumer should stop consuming messages, similar to following question
How can I Stop/start/Pause a @JmsListener (the clean way)
But I could not find the way how to configure JmsListenerEndpointRegistry bean so that I can call stop/start method on it. I googled a lot but no sample is found in which this bean configuration is shown. The only examples are from spring docs and in that also there is no configuration sample. Below is my bean definition
<<bean id="jmsListenerEndpointRegistry" class="org.springframework.jms.config.JmsListenerEndpointRegistry">
// what should be here to properly configure it?
</bean>
When I call method on this bean object, it has no reference of container.
Please Note that I am not using spring boot and hence this bean is not automatically configured.
Any help is very much appreciated.
Thanks
PS.