WebLogic Messaging API Class Library

IMessage Properties

The properties of the IMessage interface are listed below. For a complete list of IMessage interface members, see the IMessage Members topic.

Public Instance Properties

JMSCorrelationIDGets and Sets the correlation ID as a string for the message. A client can use the JMSCorrelationID header field to link one message with another. A typical use is to link a response message with its request message.A JMSCorrelationID can hold one of the following:
  • A provider-specific message ID
  • An application-specific String
  • A provider-native byte[] value
Since each message sent by JMS is assigned a message ID value, it is convenient to link messages via message ID. All message ID values Start with the 'ID:' prefix. In some cases, an application (made up of several clients) needs to use an application-specific value for linking messages. For instance, an application may use JMSCorrelationID to hold a value referencing some external information. Application-specified values must not Start with the 'ID:' prefix; this is reserved for provider-generated message ID values.
JMSCorrelationIDAsBytesGets and Sets the correlation ID as an array of bytes for the message (a byte[]). The array is copied before the method returns, so future modifications to the array will not alter this message header. The use of a byte[] value for JMSCorrelationID is non-portable between vendors.
JMSDeliveryModeGets the Constants.DeliveryMode value specified for this message.
JMSDestinationGets the IDestination object for this message. The JMSDestination header field contains the destination to which the message is being sent.Important: When a message is sent, this field is ignored. After completion of the Send or Publish method, the field holds the destination specified by the method or the producer.When a message is received, its JMSDestination value is equivalent to the value assigned when it was sent.
JMSExpirationGets the message's expiration value as a long. This field is optionally set when a message is sentImportant: When a message is sent, this field is ignored. After completion of the Send or Publish method, the field holds the expiration value set by the producer. The value is in the format of a normal millis absolute time value in the Java programming language. which is the difference, measured in milliseconds, between a given time time and midnight, January 1, 1970 UTC. For an example of how to convert between Java millisecond timestamps and .NET times, see the API doc for IMessage.JMSTimestamp.
JMSMessageIDGets the message ID as a string. The JMSMessageID header field contains a value that uniquely identifies each message sent by a provider.When a message is sent, JMSMessageID can be ignored. When the Send or Publish method returns, it contains a provider-assigned value.A JMSMessageID is a String value that functions as a unique key for identifying messages in a historical repository. The exact scope of uniqueness is provider-defined (for WebLogic JMS this value is generally unique among all server instances in all domains and across all time). All JMSMessageID values Start with the prefix 'ID:'. Uniqueness of message ID values across different JMS vendors is not guaranteed.
JMSPriorityGets the message priority level as an int. The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority.See the WebLogic documentation for information on how to configure destinations so that they sort in priority order. Important: When a message is sent, this field is ignored. After completion of the Send or Publish method, the field holds the priority value set by the producer.
JMSRedeliveredGets a boolean indication of whether this message is being redelivered (type bool). If a client receives a message with the JMSRedelivered boolean field set, it is likely, but not guaranteed, that this message was delivered earlier but that its receipt was not acknowledged at that time.
JMSReplyToGets and Sets the IDestination object to which a reply to this message should be sent. The JMSReplyTo header field contains the destination where a reply to the current message should be sent. If it is null, no reply is expected. The destination may be either an IQueue object or an ITopic object. Messages sent with a null JMSReplyTo value may be a notification of some event, or they may just be some data the sender thinks is of interest. Messages with a JMSReplyTo value typically expect a response. A response is optional; it is up to the client to decide. These messages are called requests. A message sent in response to a request is called a reply. In some cases a client may wish to match a request it sent earlier with a reply it has just received. The client can use the JMSCorrelationID header field for this purpose.
JMSTimestampGets the message timestamp as a long. The JMSTimestamp header field contains the time a message was handed off to be sent. It is not the time the message was actually transmitted, because the actual send may occur later due to transactions or other client-side queueing of messages. When a message is sent, JMSTimestamp is ignored. When the Send or Publish method returns, it contains a time value somewhere in the interval between the call and the return. The value is in the format of a normal millis absolute time value in the Java programming language, which is the difference, measured in milliseconds, between the a given time and midnight, January 1, 1970 UTC.
// Example:  Converting the current .NET time to Java millis time
DateTime baseTime = new DateTime(1970, 1, 1, 0, 0, 0);
DateTime utcNow = DateTime.UtcNow;
long timeInMillis = (utcNow.Ticks - baseTime.Ticks)/10000;
Console.WriteLine(timeInMillis);
// Example:  Converting Java millis time to .NET time
DateTime baseTime = new DateTime(1970, 1, 1, 0, 0, 0);
long utcTimeTicks = (timeInMillis * 10000) + baseTime.Ticks;
DateTime utcTime = new DateTime(utcTimeTicks, DateTimeKind.Utc);
Console.WriteLine(utcTime);
Console.WriteLine(utcTime.ToLocalTime());
JMSTypeGets/Sets the message type as a string. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The JMSType header field may reference a message's definition in the provider's repository. (WebLogic JMS currently does not have a message definition repository. Therefore, if the message will not be forwarded to a foreign vendor, the JMSType can be used to store an arbitrary value -- similar to the usage for JMSCorrelationID.)

See Also

IMessage Interface | WebLogic.Messaging Namespace | Receive() | Receive(long) | ReceiveNoWait() | MessageEventHandler | IBytesMessage | IMapMessage | IObjectMessage | IStreamMessage | ITextMessage