Delen via


ServiceBusMessage Class

Definition

The ServiceBusMessage is used to send data to Service Bus Queues and Topics. When receiving messages, the ServiceBusReceivedMessage is used.

public class ServiceBusMessage
type ServiceBusMessage = class
Public Class ServiceBusMessage
Inheritance
ServiceBusMessage

Remarks

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

Constructors

ServiceBusMessage()

Creates a new message.

ServiceBusMessage(AmqpAnnotatedMessage)

Creates a new message from the specified AmqpAnnotatedMessage instance.

ServiceBusMessage(BinaryData)

Creates a new message from the specified BinaryData instance.

ServiceBusMessage(ReadOnlyMemory<Byte>)

Creates a new message from the specified payload.

ServiceBusMessage(ServiceBusReceivedMessage)

Creates a new message from the specified received message by copying the properties.

ServiceBusMessage(String)

Creates a new message from the specified string, using UTF-8 encoding.

Properties

ApplicationProperties

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

Body

Gets or sets the body of the message.

ContentType

Gets or sets the content type descriptor.

CorrelationId

Gets or sets the correlation identifier.

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.

ScheduledEnqueueTime

Gets or sets the date and time, in UTC, at which the message should be made available to receivers. This property does not control when a message is sent by the client. Sending happens immediately when SendAsync is called. Service Bus will hide the message from receivers until the the requested time.

SessionId

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

Subject

Gets or sets an application specific subject.

TimeToLive

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

To

Gets or sets the "to" address.

TransactionPartitionKey

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

Methods

GetRawAmqpMessage()

Gets the raw AMQP message data that will be transmitted over the wire. This can be used to enable scenarios that require setting AMQP header, footer, property, or annotation data that is not exposed as top level properties in the ServiceBusMessage.

ToString()

Returns a string that represents the current message.

Applies to