Message Properties
Message Properties
Each header field has associated setter and getter methods, which are documented in the
description of the Message interface. Some header fields are intended to be set by a client, but
many are set automatically by the send or the publish method, which overrides any client-set
values.
TABLE 311
How JMS Message Header Field Values Are Set
Header Field
Set By
JMSDestination
send
or publish method
JMSDeliveryMode
send
or publish method
JMSExpiration
send
or publish method
JMSPriority
send
or publish method
JMSMessageID
send
or publish method
JMSTimestamp
send
or publish method
JMSCorrelationID
Client
JMSReplyTo
Client
JMSType
Client
JMSRedelivered
JMS provider
Message Properties
You can create and set properties for messages if you need values in addition to those provided
by the header fields. You can use properties to provide compatibility with other messaging
systems, or you can use them to create message selectors (see
). For an example of setting a property to be used as a message selector, see
The JMS API provides some predefined property names that a provider can support. The use
either of these predefined properties or of user-defined properties is optional.
Message Bodies
The JMS API defines five message body formats, also called message types, which allow you to
send and to receive data in many different forms and provide compatibility with existing
messaging formats.
describes these message types.
The JMS API Programming Model
The Java EE 5 Tutorial · September 2007
908