Brokered​Message Class

Definition

Represents the unit of communication between Service Bus clients.

[System.Xml.Serialization.XmlRoot("BrokeredMessage", Namespace="http://schemas.microsoft.com/netservices/2011/06/servicebus")]
public sealed class BrokeredMessage : IDisposable, System.Xml.Serialization.IXmlSerializable
Inheritance
BrokeredMessage
Attributes
System.Xml.Serialization.XmlRoot
Implements

Constructors

Brokered​Message()

Initializes a new instance of the BrokeredMessage class.

Brokered​Message(​Stream)

Initializes a new instance of the BrokeredMessage class.

Brokered​Message(​Object)

Initializes a new instance of the BrokeredMessage class from a given object by using DataContractSerializer with a binary XmlDictionaryWriter.

Brokered​Message(​Stream, ​Boolean)

Initializes a new instance of the BrokeredMessage class using the supplied stream as its body.

Brokered​Message(​Object, ​Xml​Object​Serializer)

Constructor that creates a BrokeredMessage from a given object using the provided XmlObjectSerializer

Properties

Content​Type

Gets or sets the type of the content.

Correlation​Id

Gets or sets the identifier of the correlation.

Dead​Letter​Source
Delivery​Count

Gets the number of deliveries.

Enqueued​Sequence​Number

Gets or sets the enqueued sequence number of the message.

Enqueued​Time​Utc

Gets or sets the date and time of the sent time in UTC.

Expires​At​Utc

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

Force​Persistence

Gets or sets a value that indicates whether the message is to be persisted to the database immediately, instead of being held in memory for a short time. This property is ignored if the message is sent to a non-express queue or topic.

Is​Body​Consumed

Specifies whether the message has been consumed.

Label

Gets or sets the application specific label.

Locked​Until​Utc

Gets the date and time in UTC until which the message will be locked in the queue/subscription.

Lock​Token

Gets the lock token assigned by Service Bus to this message.

Message​Id

Gets or sets the identifier of the message. This is a user-defined value that Service Bus can use to identify duplicate messages, if enabled.

Partition​Key

Gets or sets a partition key for sending a transactional message to a queue or topic that is not session-aware.

Properties

Gets the application specific message properties.

Reply​To

Gets or sets the address of the queue to reply to.

Reply​To​Session​Id

Gets or sets the session identifier to reply to.

Scheduled​Enqueue​Time​Utc

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.

Sequence​Number

Gets the unique number assigned to a message by the Service Bus.

Session​Id

Gets or sets the identifier of the session.

Size

Gets the size of the message in bytes.

State

Gets or sets the state of the message.

Time​To​Live

Gets or sets the message’s time to live value. This is the duration after which the message expires, starting from when the message is sent to the Service Bus. Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages.TimeToLive is the maximum lifetime that a message can receive, but its value cannot exceed the entity specified the DefaultMessageTimeToLive value on the destination queue or subscription. If a lower TimeToLive value is specified, it will be applied to the individual message. However, a larger value specified on the message will be overridden by the entity’s DefaultMessageTimeToLive value.

To

Gets or sets the send to address.

Via​Partition​Key

Gets or sets a partition key value when a transaction is to be used to send messages via a transfer queue.

Methods

Abandon()

Abandons the lock on a peek-locked message.

Abandon(​IDictionary<​String,​Object>)

Abandons the lock on a peek-locked message.

Abandon​Async()

Asynchronously abandons the lock on a peek-locked message.

Abandon​Async(​IDictionary<​String,​Object>)

Asynchronously abandons the lock on a peek-locked message.

Clone()

Clones a message, so that it is possible to send a clone of a message as a new message.

Complete()

Completes the receive operation of a message and indicates that the message should be marked as processed and deleted.

Complete​Async()

Asynchronously completes the receive operation of a message and indicates that the message should be marked as processed and deleted.

Dead​Letter()

Moves the message to the dead letter queue.

Dead​Letter(​IDictionary<​String,​Object>)

Moves the message to the dead letter queue.

Dead​Letter(​String, ​String)

Moves the message to the dead letter queue.

Dead​Letter​Async()

Asynchronously moves the message to the dead letter queue.

Dead​Letter​Async(​IDictionary<​String,​Object>)

Asynchronously moves the message to the dead letter queue.

Dead​Letter​Async(​String, ​String)

Asynchronously moves the message to the dead letter queue.

Defer()

Indicates that the receiver wants to defer the processing for this message.

Defer(​IDictionary<​String,​Object>)

Indicates that the receiver wants to defer the processing for this message.

Defer​Async()

Asynchronously indicates that the receiver wants to defer the processing for this message.

Defer​Async(​IDictionary<​String,​Object>)

Asynchronously indicates that the receiver wants to defer the processing for this message.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Get​Body<​T>()

Deserializes the brokered message body into an object of the specified type by using the DataContractSerializer with a binary XmlDictionaryReader.

Get​Body<​T>(​Xml​Object​Serializer)

Deserializes the BrokeredMessage body into an object of the specified type using DataContractSerializer with a Binary XmlObjectSerializer.

Renew​Lock()

Renews the lock on a message.

Renew​Lock​Async()

Asynchronously renews the lock on a message.

To​String()

Returns a string that represents the current message.

I​Xml​Serializable.​Get​Schema()

This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the XmlSchemaProviderAttribute to the class.

I​Xml​Serializable.​Read​Xml(​Xml​Reader)

Generates an object from its XML representation. This method is reserved for internal use and should not be used directly or indirectly (for example, using a serializer or a formatter).

I​Xml​Serializable.​Write​Xml(​Xml​Writer)

Converts an object into its XML representation. This method is reserved for internal use and should not be used directly or indirectly (e.g. using a serializer or a formatter).