Continuing from Part 1 which talked about Message Acknowledgment and means of ensuring basic reliability with JMS, here we talk about Persistence, Expiration, Priority and Temporary Queues/Topics.
What are the two delivery modes for messages to specify their Persistence? And, how do you specify them?
The two delivery modes are fields of the DeliveryMode interface and are as follows.
PERSISTENTdelivery 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.
NON_PERSISTENTdelivery mode does not require the JMS provider to store the message or otherwise guarantee that it is not lost if the provider fails.