JMS Message Header

Applies to ReadyAPI 3.57, last modified on December 20, 2024

The JMS header contains system-specific information common to all messages with JMS content, for example, the message destination, the time it was sent and so on. The body contains only application-specific data.

The header can also contain some application-specific information stored as keyword/value properties. However, not all providers allow an arbitrary amount of data to be stored in the header. It is a good idea to keep most application-specific data in the message body. Below is a list of header fields and their descriptions:

Header Type Description
JMSCorrelationID

JMSCorrelationID associates the message with some other message or application-specific ID. Usually, this value is used to determine to which message a reply is sent.

JMSReplyTo

JMSReplyTo indicates the JMS topic or JMS queue to which replies should be sent.

JMSType

The most important header value is JMSType. This is a string used to determine what kind of message is being sent. Handlers often use the JMSType value to determine how they should handle an incoming message.

JMSPriority

JMSPriority indicates the importance of the message from 0 to 9, where 0 is the least important and 9 is the most important. 4 indicates normal priority, and values over 5 indicate the message has a high priority.

JMSDeliveryMode

The JMS delivery mode can ensure the message is not lost in transition. Possible values: PERSISTENT, NON_PERSISTENT.

PERSISTENT messages cannot be lost in transition.

Note: The mode applies only to delivery, not to storage after receipt.

TimeToLive Specifies the time period for which a request will remain valid (in milliseconds). If set to zero, or if no value is specified, the request will never expire.
Send As BytesMessage Sets the type of outgoing messages to BytesMessage.
Add SoapAction as property Adds the SOAPAction and SOAPJMS_soapAction properties that have the same value as the Soap Action Method property.
Durable Subscription Name Sets a durable subscription name, the default name is durableSubscription + topic_name.
ClientID Sets a client ID for the JMS connection.
Message Selector

You can specify message selectors in JMS request headers. When clients subscribe to topics, they can also specify message selectors to filter out messages the client does not need. You can specify message selectors only in header elements.

For example, the client can specify a message selector that will display only the messages whose JMSType is atg.das.Startup. The message selector can refer both to system-specific and to application-specific header properties.

Response headers

To examine headers of the response message, use the JMS panel:

The response JMS panel

Click the image to enlarge it.

The table below lists the header properties available in the response:

Property Description

JMSMessageID

Associates a message with a unique identifier. You can use JMSMessageID values to identify messages in historical repositories.

JMSDestination

Determines a destination object to which the current message is sent. Destination objects are Topic and Queue.

JMSExpiration

Gets the expiration date of the current message. After the date has expired, the message will not be sent.

JMSRedelivered

Gets a boolean that indicates whether the current message is redelivered.

JMSCorrelationID

Associates the current message with some other message or application-specific ID. Usually this is done to determine to which message a reply is sent.

JMSTimestamp

Indicates the time the current message was received. It is useful to determine the duration between the time when the message was sent and when it was received.

JMSReplyTo

Indicates the JMS topic or JMS queue where replies should be addressed.

JMSType

Determines what kind of message is being sent. Handlers often use the JMSType value to determine how they should handle an incoming message.

JMSPriority

Indicates the importance of the message from 0 to 9, where 0 is the least important and 9 is the most important. 4 indicates normal priority, and values over 5 indicate the messages have high priority.

JMSDeliveryMode

Ensures that the message is not lost in transit

Note: The mode applies only to delivery, not to storage after receipt.

The messages can be of two types:

  • PERSISTENT – Persistent messages cannot be lost in transit without causing problems.

  • NON_PERSISTENT – Non-persistent messages can occasionally be lost without negative effects.

See Also

JMS Support

Highlight search results