Using a Temporary Queue
JMS applications typically use temporary queues to store messages that are only needed for the duration of a session. As soon as the session ends, messages on the temporary queue are deleted.
The requestor application in this example uses a temporary queue to store reply messages. The following lines of code demonstrate the usage of a temporary queue for reply messages:
MessageConsumer receiver;
Queue replyQueue;
...
replyQueue = session.createTemporaryQueue();
receiver = session.createConsumer(replyQueue);