Question

How to destroy my JMS Message listener ?

I tried writing a code to set it to null, but that does not help

Was it helpful?

Solution

Call the close() on the consumer that have the message listener set.

MessageConsumer consumer = session.createConsumer(destination, selector);
consumer.setMessageListener(listener);
...
/* Listening is working */
...
consumer.close();
/* Listening is NOT working anymore */
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top