The PERSISTENT delivery mode, which is the default, instructs the JMS provider to take extra care to ensure that a message is not lost in transit in case of a JMS provider failure. A message sent with this delivery mode is logged to stable storage when it is sent.
Change the message send statement as shown below
m_sender.send(mesg, 1, 2, 3000); - Use below statement to set priority level to individual messages
Expire the message sent after 3 seconds and priority level set to 2
m_sender.setPriority(2) - Use this statement to set priorty 2 to all messages sent.
.
m_sender.setTimeToLive (3000) - Use this statement to set Expiration time to all messages sent.
priority levels : 0 (lowest) - 9 (highest)
default : 4
Message with highest priority send first.
The NON_PERSISTENT delivery mode does not require the JMS provider to store the message or otherwise guarantee that it is not lost if the provider fails.
Using the NON_PERSISTENT delivery mode may improve performance and reduce storage overhead, but you should use it only if your application can afford to miss messages
TemporaryQueue m_queue=m_queueSess.createTemporaryQueue();
QueueSender m_sender=m_queueSess.createSender(m_queue);