JMS Message Bodies

A JMS message has one of several types of message bodies, or no message body at all.

The types of messages are described in the following table.

Message Type Contents of Message Body
Message This message type has no body. This is useful for simple event notification.
TextMessage A java.lang.String.
MapMessage A set of name/value pairs. The names are java.lang.String objects, and the values are Java primitive value types or their wrappers. The entries can be accessed sequentially by enumeration or directly by name. The order of entries is undefined.
BytesMessage A stream of uninterrupted bytes. The bytes are not typed; that is, they are not assigned to a primitive data type.
StreamMessage A stream of primitive values in the Java programming language. Each set of values belongs to a primitive data type, and must be read sequentially.
ObjectMessage A serializable object constructed in the Java programming language.