The message body contains the data that clients want to exchange.
The type of a JMS message determines what the body may contain and how it should be processed by the consumer, as specified in Table 2–4. The Session object includes a create method for each type of message body.
Table 2–4 Message Body Types
Type |
Description |
---|---|
A message whose body contains a stream of Java primitive values. It is filled and read sequentially. |
|
A message whose body contains a set of name-value pairs. The order of entries is not defined. |
|
A message whose body contains a Java string, for example an XML message. |
|
A message whose body contains a serialized Java object. |
|
A message whose body contains a stream of uninterpreted bytes. |
|
A message that contains a header and properties but no body. |
Java clients can set a property to have the client runtime compress the body of a message being sent. The Message Queue runtime on the consumer side decompresses the message before delivering it.