Share via


Message Class

Definition

The message object used to communicate and transfer data with Service Bus.

public class Message
type Message = class
Public Class Message
Inheritance
Message

Remarks

The message structure is discussed in detail in the product documentation.

Constructors

Message()

Creates a new Message

Message(Byte[])

Creates a new message from the specified payload.

Fields

DeadLetterErrorDescriptionHeader

User property key representing detailed error description, when a message is received from a deadletter subqueue of an entity.

DeadLetterReasonHeader

User property key representing deadletter reason, when a message is received from a deadletter subqueue of an entity.

Properties

Body

Gets or sets the body of the message.

ContentType

Gets or sets the content type descriptor.

CorrelationId

Gets or sets the a correlation identifier.

ExpiresAtUtc

Gets the date and time in UTC at which the message is set to expire.

Label

Gets or sets an application specific label.

MessageId

Gets or sets the MessageId to identify the message.

PartitionKey

Gets or sets a partition key for sending a message to a partitioned entity.

ReplyTo

Gets or sets the address of an entity to send replies to.

ReplyToSessionId

Gets or sets a session identifier augmenting the ReplyTo address.

ScheduledEnqueueTimeUtc

Gets or sets the date and time in UTC at which the message will be enqueued. This property returns the time in UTC; when setting the property, the supplied DateTime value must also be in UTC.

SessionId

Gets or sets the session identifier for a session-aware entity.

Size

Gets the total size of the message body in bytes.

SystemProperties

Gets the Message.SystemPropertiesCollection, which is used to store properties that are set by the system.

TimeToLive

Gets or sets the message’s "time to live" value.

To

Gets or sets the "to" address.

UserProperties

Gets the "user properties" bag, which can be used for custom message metadata.

ViaPartitionKey

Gets or sets a partition key for sending a message into an entity via a partitioned transfer queue.

Methods

Clone()

Clones a message, so that it is possible to send a clone of an already received message as a new message. The system properties of original message are not copied.

ToString()

Returns a string that represents the current message.

Extension Methods

ExtractActivity(Message, String)

Creates Activity based on the tracing context stored in the MessageOptional Activity nameNew Activity with tracing context

GetBody<T>(Message, XmlObjectSerializer)

Deserializes the body of a message that was serialized using XmlObjectSerializer

Applies to