WebLogic Messaging API Class Library |

# IMessage Members

IMessage overview

#### Public Instance Properties

JMSCorrelationID | Gets 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.
JMSCorrelationIDAsBytes | Gets 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.
JMSDeliveryMode | Gets the `Constants.DeliveryMode` value specified for this message.
JMSDestination | Gets 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.
JMSExpiration | Gets 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`.
JMSMessageID | Gets 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.
JMSPriority | Gets 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.
JMSRedelivered | Gets 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.
JMSReplyTo | Gets 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.
JMSTimestamp | Gets 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());
JMSType | Gets/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.)

#### Public Instance Methods

Acknowledge | Acknowledges all consumed messages of the session of this consumed message. All consumed JMS messages support the `Acknowledge` method for use when a client has specified that its JMS session's consumed messages are to be explicitly acknowledged. By invoking `Acknowledge` on a consumed message, a client acknowledges all messages consumed by the session that the message was delivered to. Calls to `Acknowledge` are ignored for both transacted sessions and sessions specified to use implicit acknowledgement modes. A client may individually Acknowledge each message as it is consumed, or it may choose to Acknowledge messages as an application-defined group (which is done by calling Acknowledge on the last received message of the group, thereby acknowledging all messages consumed by the session.) WebLogic provides an optional extension that is configurable on the connection factory which controls acknowledge behavior: the acknowledge policy can be set to "acknowledge all", or "acknowledge previous", where "acknowledge previous" is an extension that causes calls acknowledges to only acknowledge messages up to and including the current message instead of all of a session's unacknowledged messages. A client may individually Acknowledge each message as it is consumed, or it may choose to Acknowledge messages as an application-defined group (which is done by calling Acknowledge on the last received message of the group, thereby acknowledging all messages consumed by the session.) Messages that have been received but not acknowledged may be redelivered.
ClearBody | Clears out the message body. Clearing a message's body does not clear its header values or property entries. If this message body was read-only, calling this method leaves the message body in the same state as an empty body in a newly created message.
ClearProperties | Clears a message's properties. The message's header fields and body are not cleared.
GetBooleanProperty | Returns the value of the `boolean` property with the specified name.
GetByteProperty | Returns the value of the `sbyte` property with the specified name.
GetDoubleProperty | Returns the value of the `double` property with the specified name.
GetFloatProperty | Returns the value of the `float` property with the specified name.
GetIntProperty | Returns the value of the `int` property with the specified name.
GetLongProperty | Returns the value of the `long` property with the specified name.
GetObjectProperty | Returns the value of the primitive object property with the specified name. This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalent `SetObjectProperty` method call, or its equivalent primitive `settypeProperty` method.
GetPropertyNames | Returns an `Enumeration` of all the property names. Note that JMS standard header fields are not considered properties and are not returned in this enumeration.
GetShortProperty | Returns the value of the `short` property with the specified name.
GetStringProperty | Returns the value of the `String` property with the specified name.
PropertyExists | Indicates whether a property value exists.
SetBooleanProperty | Sets a `boolean` property value with the specified name into the message.
SetByteProperty | Sets a `sbyte` property value with the specified name into the message.
SetDoubleProperty | Sets a `double` property value with the specified name into the message.
SetFloatProperty | Sets a `float` property value with the specified name into the message.
SetIntProperty | Sets an `int` property value with the specified name into the message.
SetLongProperty | Sets a `long` property value with the specified name into the message.
SetObjectProperty | Sets a primitive object property value with the specified name into the message. Note that this method works only for the objectified primitive object types (`int`, `double`, `long` ...) and `String` objects.
SetShortProperty | Sets a `short` property value with the specified name into the message.
SetStringProperty | Sets a `String` property value with the specified name into the message.

#### See Also

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