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, the isRunning()
return False, but I still get messages through the MQueue... the onMessage
gets triggered.
jmsManagement
is an instance of the class Lifecycle
. Even when I changed it to DefaultMessageListenerContainer
, same thing.
- I'm receiving messages before calling
start()
, even when autoStartup
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 ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…