getJMSMessageID

 

public String getJMSMessageID() throws JMSException;

Gets the message ID.

The messageID header field contains a value that uniquely identifies each message sent by a provider.

When a message is sent, messageID can be ignored. When the send() method returns, it contains a provider-assigned value.

A JMSMessageID is a String value which functions as a unique key for identifying messages in a historical repository. The exact scope of uniqueness is provider defined. It must at least cover all messages for a specific installation of a provider where an installation is some connected set of message routers.

All JMSMessageID values must start with the prefix `ID:'. Uniqueness of message ID values across different providers is not required.

There is an overhead in creating a message ID and it also increases a message's size. Some JMS providers can optimize this overhead if they are given a hint that the message ID is not used by an application. JMS message Producers provide a hint to disable the message ID. When a client sets a Producer to disable the message ID it indicates they are saying that they do not depend on the value of the message ID for the messages it produces. These messages must either have message ID set to null or, if the hint is ignored, the messageID must be set to its normal unique value.

Returns

  • the message ID.

Exceptions

  • JMSException - if an internal error occurs.


uj26550_