I have the following configuration for my MQueue:
<jms:listener-container container-type="default" connection-factory="cachedConnectionFactory" acknowledge="auto">
<jms:listener id="myListenerId" destination="myDestination" ref="myListener" method="onMessage" />
</jms:listener-container>
When I try to stop the reception of JMS messages, I write the following code
jmsManagement = myProject.instance.getContext().getBean('myListenerId',Lifecycle.class);
jmsManagement.stop();
PS :
- When I
stop()
my listener, theisRunning()
return False, but I still get messages through the MQueue... theonMessage
gets triggered. jmsManagement
is an instance of the classLifecycle
. Even when I changed it toDefaultMessageListenerContainer
, same thing.- I'm receiving messages before calling
start()
, even whenautoStartup
is set to false. jmsManagement.shutdown();
didn't stop the listener from being triggered.
Does anyone have an idea about how to stop this MQ listener ? Is there something I'm missing ?