JMS Messages are composed of the following parts:
- Header
- All messages support the same set of header fields. Header fields
contain values that are used by both clients and providers to identify and
route messages.
- Properties
- Each message contains a built-in facility to support application-defined
property values. Properties provide an efficient mechanism to filter
application-defined messages.
- Body
- JMS defines several types of message body which cover the majority of
messaging styles currently in use.
JMS defines five types of message body:
- Stream
- a stream of Java primitive values. It is filled and read
sequentially.
- Map
- a set of name-value pairs, where names are Strings and values are Java
primitive types. The entries can be accessed sequentially or randomly
by name. The order of the entries is undefined.
- Text
- a message containing a java.util.String.
- Object
- a message that contains a Serializable java object
- Bytes
- a stream of uninterpreted bytes. This message type is for literally
encoding a body to match an existing message format.
The JMSCorrelationID header field is used to link one message with
another. It typically links a reply message with its requesting
message. JMSCorrelationID can hold a provider-specific message ID, an
application-specific String, or a provider-native byte[]
value.
© IBM Corporation 1997, 2002. All Rights Reserved