JMS Message Structure
A JMS message has the same structure, regardless of whether it is addressed to a topic or a queue. A JMS message has three sections:
Header Fields
The header contains ten predefined fields that contain values used to route and deliver messages. Table 6 describes the message header fields.
Table 6 JMS Message Headers (Sheet 1 of 2)
Header Field
|
Set by
|
Comments
|
JMSDestination
|
send or publish method
|
Destination to which message is sent
|
JMSDeliveryMode
|
send or publish method
|
Persistent or non-persistent message
|
JMSExpiration
|
send or publish method
|
Length of time that message will live before expiration. If set to 0, message does not expire. The time-to-live is specified in milliseconds.
Whenever your application uses non-zero values for message expiration, you must ensure that clocks are synchronized among all the host computers that send and receive messages. Synchronize clocks to a tolerance that is a very small fraction of the smallest message expiration time.
|
JMSPriority
|
send or publish method
|
Uses a numerical ranking, between 0 and 9, to define message priority as normal or expedited. Larger numbers represent higher priority.
|
JMSMessageID
|
send or publish method
|
Value uniquely identifies each message sent by a provider.
|
JMSTimestamp
|
send or publish method
|
Timestamp of time when message was handed off to a provider to be sent. Message may actually be sent later than this timestamp.
|
JMSCorrelationID
|
message client
|
This ID can be used to link messages, such as linking a response message to a request message. Entering a value in this field is optional.
|
JMSReplyTo
|
message client
|
A destination to which a message reply should be sent. Entering a value for this field is optional.
|
JMSType
|
message client
|
message type identifier
|
JMSRedelivered
|
JMS provider
|
If this field is set, it is possible that the message was delivered to the client earlier, but not acknowledged at that time.
|
Properties
In the properties area, applications, vendors, and administrators on JMS systems can add optional properties. The properties area is optional, and can be left empty.
TIBCO Enterprise Message Service includes several vendor-specific properties in this area. TIBCO-specific property names begin with JMS_TIBCO
. These properties are described in subsequent sections in this chapter.
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 Table 7.
Table 7 JMS Message Types (Sheet 1 of 2)
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 . For example, this can be the contents of an XML file.
|
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.
|
Maximum Message Size
EMS supports messages up to a maximum size of 512MB. However, we recommend that application programs use smaller messages, since messages approaching this maximum size will strain the performance limits of most current hardware and operating system platforms.
TIBCO Enterprise Message Service™ User’s Guide
Software Release 4.3,
February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com
|