Message reliability indicates how a message is treated, within a Messaging Engine that affects ability to recover the message after various failures or after certain administrative operations. The different reliability settings trigger specific tasks, during message processing, that help to achieve the expected behavior in terms of recoverability of messages.
This link provides the detailed information about various reliability levels.
These reliability settings can be configured on SIBus destinations, or JMS connection factories, JMS Destinations, or can be dynamically set during the runtime. The JMS API provides only PERSISTENCE or NONPERSISTENCE delivery modes. These JMS delivery modes are mapped to five message reliability QOS settings which are provided by SIBus.
This blog explains locations where we can configure the JMS delivery mode and SIBus message reliability QOS settings, and explains order in which these settings take precedence while processing at runtime.
We can configure the SIBus message reliability QOS settings on a SIBus destination (Queue destination or Topicspace) through admin console. The below figure explains it.
Figure1. Reliability settings on SIBus destinations
The Default Reliability specifies the reliability level that is used for messages by default when the message producing applications do not set any value while producing the messages. I will explain how applications can influence reliability level on the messages later in the blog.
The Maximum reliability specifies the maximum reliability level with which messages can be sent to this destination.
The Enable producers to override default reliability specifies whether producers are allowed to override the Default reliability setting.
If the application produces messages with a different reliability level than the Default Reliability value, and the Enable producers to override default reliability is not set, then the value set by the application is ignored. Only the value set for Default Reliability is honored in this case.
Internally, SIBus creates different data structures to hold the messages according to their priority and reliability. The JMS API provides 0 to 9 (10) priority levels for messages. There are 5 reliability levels provided by SIBus. If the application always produces messages only with a certain reliability level and does not produce messages with any higher reliability level, then setting the value of Maximum reliability to the required reliability level helps to reduce the runtime overhead to maintain all reliability levels. This might also improve performance. We should also make sure that applications should not produce messages with reliability level higher than what is set for Maximum reliability. Otherwise, message processing will fail.
The JMS connection factories also allow configuring the QOS settings for the message reliability through administration console. The below figure explains it.
Figure2. Mapping JMS Delivery modes to SIBus reliability settings on Connection Factory configuration
As explained earlier, the JMS API provides only two modes of delivery PERSISTENCE and NONPERSISTENCE. For JMS NONPERSISTENCE delivery mode, SIBus can provide three levels of reliability level namely
For JMS PERSISTENCE delivery mode, SIBus provides two levels of reliability namely
The two dropdown boxes Nonpersistent message reliability and Persistent message reliability in the Figure2 allow to map JMS delivery modes to SIBus reliability levels. That is, if a JMS application produces messages with JMS delivery mode as NONPERSISTENCE, the value selected in the dropdown box Nonpersistent message reliability specifies which of the three reliability levels are going to be used by SIBus for the messages. Similarly, if a JMS application produces messages with JMS delivery mode as PERSISTENCE, the value selected in the dropdown box Persistent message reliability specifies which of the two reliability levels are going to be used by SIBus for the messages.
Hence, it is the connection factory setting that selects the suitable SIBus reliability level according to the JMS delivery mode set in the JMS message.
Finally, we can set the JMS delivery mode on a JMS destination (Queue or Topic) through administration console. The dropdown list Delivery mode allows selecting one of the following three values. The below figure explains it.
Figure3. Settings JMS Delivery modes on JMS Destinations
The persistence of messages on this JMS destination is defined by the producing JMS application at runtime. The JMS application can set the delivery mode by using the JMS API as follows.
int deliveryMode, int priority, long timeToLive)
Similar methods are available on QueueSender and TopicPublisher as well.
All messages sent to this JMS destination are treated as nonpersistent.
All messages sent to this JMS destination are treated as persistent.
For example, if the value Application is selected for the Delivery mode (Figure3), then the JMS deliver mode set by the JMS application at runtime, is mapped to appropriate SIBus message reliability setting configured on the JMS connection factory (Figure2). In addition, if Enable producers to override default reliability checkbox is selected (Figure1), then the mapped SIBus message reliability level is used at runtime for the message.