Headers associate a fixed set of header field names with values. Clients and providers use headers to identify and route messages.
Programs can access headers as .NET properties of the message object.
Header
|
Description
|
---|---|
JMS Headers
These .NET properties correspond to message headers defined in the JMS specification.
Programs can get all supported message header properties (see MessageGet Properties).
Programs can effectively set only three message header properties |
|
CorrelationID
|
string {get; set;}
Correlation ID refers to a related message. For example, when a consumer responds to a request message by sending a reply, it can set the correlation ID of the reply to indicate the request message.
The JMS specification allows three categories of values for the correlation ID property:
Message ID strings begin with the prefix
These strings must not begin with the prefix |
CorrelationIDAsBytes
|
byte[] {get; set;}
The JMS specification describes this optional utility, but EMS does not support it. Attempting to access this header results in
System.InvalidOperationException .
|
DeliveryMode
|
int {get; set;}
This header instructs the server concerning persistent storage for the message.
Sending calls record the delivery mode for each message, based on either a property of the producer (
DeliveryMode ), or on a parameter to the sending call.
For values, see the class
DeliveryMode .
|
MsgDeliveryMode
|
MessageDeliveryMode {get; set;}
This parallel .NET property accesses the same header using enumerated values (instead of ordinary integers). We recommend it over the ordinary integer-valued accessor, because it enables .NET to do stronger type checking at compile time, which can enhance program reliability.
For values, see the class
MessageDeliveryMode .
|
Destination
|
Destination {get; set;}
Sending calls record the destination (queue or topic) of the message in this header (ignoring and overwriting any existing value). The value is based on either a property of the producer (
Destination ), or on a parameter to the send call.
Listeners that consume messages from several destinations can use this property to determine the actual destination of a message.
|
Expiration
|
long {get; set;}
Sending calls record the expiration time (in milliseconds) of the message in this field:
The server discards a message when its expiration time has passed. However, the JMS specification does not guarantee that clients do not receive expired messages.
See
TimeToLive .
|
MessageID
|
string {get; set;}
Sending calls assign a unique ID to each message, and record it in this header.
All message ID values start with the 3-character prefix
ID: (which is reserved for this purpose).
Applications that do not require message IDs can reduce overhead costs by disabling IDs; see
DisableMessageID . When the producer disables IDs, the value of this header is null.
|
MsgType
|
string {get; set;}
Some JMS providers use a message repository to store message type definitions. Client programs can store a value in this field to reference a definition in the repository. EMS supports this header, but does not use it.
The JMS specification does not define a standard message definition repository, nor does it define a naming policy for message type definitions.
Some providers require message type definitions for each application message. To ensure compatibility with such providers, client programs can set this header, even if the client application does not use it.
To ensure portability, clients can set this header with symbolic values (rather than literals), and configure them to match the provider’s repository.
|
Priority
|
int {get; set;}
Sending calls record the priority of a message in this header, based on either a property of the producer (
Priority ), or on a parameter to the send call.
The JMS specification defines ten levels of priority value, from zero (lowest priority) to 9 (highest priority). The specification suggests that clients consider 0–4 as gradations of normal priority, and priorities 5–9 as gradations of expedited priority.
Priority affects the order in which the server delivers messages to consumers (higher values first). The JMS specification does not require all providers to implement priority ordering of messages. (EMS supports priorities, but other JMS providers might not.)
|
Redelivered
|
bool {get; set;}
The server sets this header to indicate whether a message might duplicate a previously delivered message:
See also,
SessionMode .
|
ReplyTo
|
Destination {get; set;}
Sending clients can set this header to request that recipients reply to the message:
When sending a reply, clients can refer to the corresponding request by setting the
CorrelationID field.
|
Timestamp
|
long {get; set;}
Sending calls record a UTC timestamp in this header, indicating the approximate time that the server accepted the message.
The value is in milliseconds since January 1, 1970 (as in Java).
Applications that do not require timestamps can reduce overhead costs by disabling timestamps; see
DisableMessageTimestamp . When the producer disables timestamps, the value of this header is zero.
|
TIBCO Enterprise Message Service™ .NET Reference System Release 4.3, February 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |