Supported Message Types
The table below lists the standard JMS message types that are supported as well as the corresponding information about how to create them and how to set data to and get data from the message body.
For a comprehensive list of the available methods that can be used for get/set or read/write operations, refer to JMS API Reference.
Type and Description | To create a message of this type, call... | To get and set data... |
---|---|---|
Message—The Message interface is the root interface of all JMS messages. A Message object holds all the standard message header information. It can be sent when a message containing only header information is sufficient. |
session. |
It is recommended that a message body of one of the following types is defined:
|
StreamMessage—Message body contains a stream of Java primitive values. The message body is filled and read sequentially. |
session. |
Use StreamMessage read and write methods for primitive types. For example, |
MapMessage—Message body contains a set of name-value pairs, where the names are string objects, and the values are Java primitives. The pairs can be accessed sequentially or randomly by name. |
session. |
Use MapMessage get and set methods for name-value pairs, where the names are String objects, and the values are primitive data types in the Java programming language. For example, |
TextMessage—Message body contains a java.lang.String. This message type can be used for plain text messages. It can also be used for XML messages if the Solace proprietary message property |
session.createText |
|
ObjectMessage—Message body contains a serializable Java object. |
session. |
|
BytesMessage—Message body contains a stream of uninterpreted bytes. |
session. |
Use BytesMessage read and write methods. For example, |