JMS-Defined Properties
JMS-defined properties have the same characteristics as
application properties, except that most of them are set automatically
by the JMS provider when the message is sent. JMS-defined properties are
basically optional JMS headers; vendors can choose to support none,
some, or all of them. There are nine JMS-defined properties, each of
which starts with “JMSX” in the property name. Note that there is no
corresponding getJMSX<property>() and setJMSX<property>() methods on the
Message object; these properties are
accessed in the same manner application properties are. For example, the
following code checks to see if an application ID has been set by the
JMS provider:
public void onMessage(Message message) {
if (message.propertyExists("JMSXAppID")) {
String appId = message.getStringProperty("JMSXAppID");
}
...
}Optional JMS-Defined Properties
Here are the optional JMS-defined properties and their descriptions:
JMSXUserIDThis property is a
Stringthat is set automatically by the JMS provider when the message is sent. Some JMS providers can assign a client a user ID, which is the value associated with this property.JMSXAppIDThis property is a
Stringthat is set automatically by the JMS provider when the message is sent. Some JMS providers can assign an identifier to a specific JMS application, which is a set of consumers and subscribers that communicate using a set of destinations.JMSXProducerTXIDandJMSXConsumerTXIDMessages can be produced and consumed within a transaction. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access