LibraryLink ToToggle FramesPrintFeedback

JMS Message Qualities of Service

JMS messages have a number of quality of service properties that can be set. These QoS properties include the following:

These properties are all stored in the JMS message header. By default, the JMS broker automatically populates their values. You can, however, configure an endpoint to override the broker's default.

You configure the endpoint to set the priority for all out going JMS messages using the priority attribute. The value you provide for the priority attribute is used to set the JMS message's JMSPriority property.

JMS priority values can range from 0 to 9. 0 is the lowest priority and 9 is the highest. If you do not provide a value, the JMS provider will use the default priority value of 4. The default priority is considered normal.

In JMS a message's persistence is controlled by its delivery mode property. You configure the delivery mode of the messages produced by a JMS provider by setting its deliveryMode attribute. The value you provide for the deliveryMode attribute is used to set the JMS message's JMSDeliveryMode property.

JMS implementations support two delivery modes: persistent and non-persistent.

Persistent messages can survive a shutdown of the JMS broker. This is the default setting for JMS messages. You can specify persistence by setting the endpoint's deliveryMode attribute to 2. This setting corresponds to DeliveryMode.PERSISTENT.

Non-persistent messages are lost if the JMS broker is shutdown before they are delivered. You can specify non-persistence by setting the endpoint's deliveryMode attribute to 1. This setting corresponds to DeliveryMode.NON_PERSISTENT.

You can control how long messages persists before the JMS broker reap them by setting the endpoint's timeToLive attribute. The value is the number of milliseconds you want the message to be available from the time it is sent. The default behavior is to allow messages to persist forever.

The value of the timeToLive attribute is used to compute the value for the message's JMSExpirary property. The value is computed by adding the specified number of milliseconds to the time the message is created.

By default, a JMS provider endpoint will allow the JMS provider to set these values to default values and ignore any values set through the configuration. To override this behavior, you need to set the endpoint's explicitQosEnabled attribute to true.

Example 4.5 shows configuration for a JMS SOAP provider whose messages have a priority of 1.