As far as I cannot set a listener to a TemporaryQueue, I do the following:
I create a permanent queue through destination manager, attach a listener to it, catch the message onto that queue, and later want to destroy the queue via destination manager.
In order to do that I send a message to MDV from inside the callback, that caught a message. The request to MDB invokes destination manager to destroy the queue. The queue is destroyed, the MDB answers back via TemporaryQueue back to callback, and that is it.
However, what happens - when the callback is called, and MDB is called to destroy the queue via destination manager, I have the following exception :
16:34:10,506 WARN [OILServerILService] Client request resulted in a server exce
javax.jms.InvalidDestinationException: The subscription's destination QUEUE.1065
818050178 does not exist
Here the queue QUEUE.1065818050178 is the queue which received the message (via callback). And which was successfully destroyed via a call to MDB, which invoked destroyMessage method on destination manager.
MDB never returned the response bacj to callback via temporary queue after that.
How can I prevent this from happening?
Immediately before that I have the following printout from destination manager :
16:34:10,475 INFO  Stopping
16:34:10,475 INFO  Stopped
16:34:10,490 INFO  Destroying
16:34:10,490 INFO  Destroyed