ServiceBusReceivedMessage interface

Describes the message received from Service Bus during peek operations and so cannot be settled.

Extends

Properties

deadLetterErrorDescription

The error description for deadlettering the message.

deadLetterReason

The reason for deadlettering the message.

deadLetterSource

The name of the queue or subscription that this message was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the entity in which the message was dead-lettered.

deliveryCount

Number of deliveries that have been attempted for this message. The count is incremented when a message lock expires, or the message is explicitly abandoned using the abandon() method on the message.

enqueuedSequenceNumber

The original sequence number of the message. For messages that have been auto-forwarded, this property reflects the sequence number that had first been assigned to the message at its original point of submission.

enqueuedTimeUtc

The UTC instant at which the message has been accepted and stored in Service Bus.

expiresAtUtc

The UTC instant at which the message is marked for removal and no longer available for retrieval from the entity due to expiration. This property is computed from 2 other properties on the message: enqueuedTimeUtc + timeToLive.

lockedUntilUtc

The UTC instant until which the message is held locked in the queue/subscription. When the lock expires, the deliveryCount is incremented and the message is again available for retrieval.

  • Not applicable when the message is received in receiveAndDelete receive mode. mode.
lockToken

The lock token is a reference to the lock that is being held by the broker in peekLock receive mode. Locks are used internally settle messages as explained in the product documentation in more detail

  • Not applicable when the message is received in receiveAndDelete receive mode. mode.
sequenceNumber

The unique number assigned to a message by Service Bus. The sequence number is a unique 64-bit integer assigned to a message as it is accepted and stored by the broker and functions as its true identifier. For partitioned entities, the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase. They roll over to 0 when the 48-64 bit range is exhausted.

Max safe integer that Javascript currently supports is 2^53 - 1. The sequence number is an AMQP Long type which can be upto 64 bits long. To represent that we are using a library named long.js. We expect customers to use the Long type exported by this library.

state

State of the message can be active, deferred or scheduled. Deferred messages have deferred state, scheduled messages have scheduled state, all other messages have active state.

Inherited Properties

applicationProperties

The application specific properties which can be used for custom message metadata.

body

The message body that needs to be sent or is received. If the application receiving the message is not using this SDK, convert your body payload to a byte array or Buffer for better cross-language compatibility.

contentType

The content type of the message. Optionally describes the payload of the message, with a descriptor following the format of RFC2045, Section 5, for example "application/json".

correlationId

The correlation identifier that allows an application to specify a context for the message for the purposes of correlation, for example reflecting the MessageId of a message that is being replied to. See Message Routing and Correlation.

messageId

The message identifier is an application-defined value that uniquely identifies the message and its payload.

Note: Numbers that are not whole integers are not allowed.

partitionKey

The partition key for sending a message to a partitioned entity. Maximum length is 128 characters. For partitioned entities, setting this value enables assigning related messages to the same internal partition, so that submission sequence order is correctly recorded. The partition is chosen by a hash function over this value and cannot be chosen directly.

  • For session-aware entities, the sessionId property overrides this value.
  • For non partitioned entities, partition key will be ignored
replyTo

The address of an entity to send replies to. This optional and application-defined value is a standard way to express a reply path to the receiver of the message. When a sender expects a reply, it sets the value to the absolute or relative path of the queue or topic it expects the reply to be sent to. See Message Routing and Correlation.

replyToSessionId

The session identifier augmenting the replyTo address. Maximum length is 128 characters. This value augments the ReplyTo information and specifies which SessionId should be set for the reply when sent to the reply entity. See Message Routing and Correlation.

scheduledEnqueueTimeUtc

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. This value is for delayed message sending. It is utilized to delay messages sending to a specific time in the future. Message enqueuing time does not mean that the message will be sent at the same time. It will get enqueued, but the actual sending time depends on the queue's workload and its state.

sessionId

The session identifier for a session-aware entity. Maximum length is 128 characters. For session-aware entities, this application-defined value specifies the session affiliation of the message. Messages with the same session identifier are subject to summary locking and enable exact in-order processing and demultiplexing. For session-unaware entities, this value is ignored. Message Sessions.

subject

The application specific label. This property enables the application to indicate the purpose of the message to the receiver in a standardized. fashion, similar to an email subject line. The mapped AMQP property is "subject".

timeToLive

The message’s time to live value. This value is the relative duration after which the message expires, starting from the instant the message has been accepted and stored by the broker, as captured in enqueuedTimeUtc. When not set explicitly, the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level timeToLive value cannot be longer than the entity's DefaultTimeToLive setting and it is silently adjusted if it does. See Expiration.

to

The "to" address. This property is reserved for future use in routing scenarios and presently ignored by the broker itself. Applications can use this value in rule-driven auto-forward chaining scenarios to indicate the intended logical destination of the message.

Property Details

deadLetterErrorDescription

The error description for deadlettering the message.

deadLetterErrorDescription?: string

Property Value

string

deadLetterReason

The reason for deadlettering the message.

deadLetterReason?: string

Property Value

string

deadLetterSource

The name of the queue or subscription that this message was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the entity in which the message was dead-lettered.

deadLetterSource?: string

Property Value

string

deliveryCount

Number of deliveries that have been attempted for this message. The count is incremented when a message lock expires, or the message is explicitly abandoned using the abandon() method on the message.

deliveryCount?: number

Property Value

number

enqueuedSequenceNumber

The original sequence number of the message. For messages that have been auto-forwarded, this property reflects the sequence number that had first been assigned to the message at its original point of submission.

enqueuedSequenceNumber?: number

Property Value

number

enqueuedTimeUtc

The UTC instant at which the message has been accepted and stored in Service Bus.

enqueuedTimeUtc?: Date

Property Value

Date

expiresAtUtc

The UTC instant at which the message is marked for removal and no longer available for retrieval from the entity due to expiration. This property is computed from 2 other properties on the message: enqueuedTimeUtc + timeToLive.

expiresAtUtc?: Date

Property Value

Date

lockedUntilUtc

The UTC instant until which the message is held locked in the queue/subscription. When the lock expires, the deliveryCount is incremented and the message is again available for retrieval.

  • Not applicable when the message is received in receiveAndDelete receive mode. mode.
lockedUntilUtc?: Date

Property Value

Date

lockToken

The lock token is a reference to the lock that is being held by the broker in peekLock receive mode. Locks are used internally settle messages as explained in the product documentation in more detail

  • Not applicable when the message is received in receiveAndDelete receive mode. mode.
lockToken?: string

Property Value

string

sequenceNumber

The unique number assigned to a message by Service Bus. The sequence number is a unique 64-bit integer assigned to a message as it is accepted and stored by the broker and functions as its true identifier. For partitioned entities, the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase. They roll over to 0 when the 48-64 bit range is exhausted.

Max safe integer that Javascript currently supports is 2^53 - 1. The sequence number is an AMQP Long type which can be upto 64 bits long. To represent that we are using a library named long.js. We expect customers to use the Long type exported by this library.

sequenceNumber?: Long

Property Value

Long

state

State of the message can be active, deferred or scheduled. Deferred messages have deferred state, scheduled messages have scheduled state, all other messages have active state.

state: "active" | "deferred" | "scheduled"

Property Value

"active" | "deferred" | "scheduled"

Inherited Property Details

applicationProperties

The application specific properties which can be used for custom message metadata.

applicationProperties?: {[key: string]: number | boolean | string | Date | null}

Property Value

{[key: string]: number | boolean | string | Date | null}

Inherited From ServiceBusMessage.applicationProperties

body

The message body that needs to be sent or is received. If the application receiving the message is not using this SDK, convert your body payload to a byte array or Buffer for better cross-language compatibility.

body: any

Property Value

any

Inherited From ServiceBusMessage.body

contentType

The content type of the message. Optionally describes the payload of the message, with a descriptor following the format of RFC2045, Section 5, for example "application/json".

contentType?: string

Property Value

string

Inherited From ServiceBusMessage.contentType

correlationId

The correlation identifier that allows an application to specify a context for the message for the purposes of correlation, for example reflecting the MessageId of a message that is being replied to. See Message Routing and Correlation.

correlationId?: string | number | Buffer

Property Value

string | number | Buffer

Inherited From ServiceBusMessage.correlationId

messageId

The message identifier is an application-defined value that uniquely identifies the message and its payload.

Note: Numbers that are not whole integers are not allowed.

messageId?: string | number | Buffer

Property Value

string | number | Buffer

Inherited From ServiceBusMessage.messageId

partitionKey

The partition key for sending a message to a partitioned entity. Maximum length is 128 characters. For partitioned entities, setting this value enables assigning related messages to the same internal partition, so that submission sequence order is correctly recorded. The partition is chosen by a hash function over this value and cannot be chosen directly.

  • For session-aware entities, the sessionId property overrides this value.
  • For non partitioned entities, partition key will be ignored
partitionKey?: string

Property Value

string

Inherited From ServiceBusMessage.partitionKey

replyTo

The address of an entity to send replies to. This optional and application-defined value is a standard way to express a reply path to the receiver of the message. When a sender expects a reply, it sets the value to the absolute or relative path of the queue or topic it expects the reply to be sent to. See Message Routing and Correlation.

replyTo?: string

Property Value

string

Inherited From ServiceBusMessage.replyTo

replyToSessionId

The session identifier augmenting the replyTo address. Maximum length is 128 characters. This value augments the ReplyTo information and specifies which SessionId should be set for the reply when sent to the reply entity. See Message Routing and Correlation.

replyToSessionId?: string

Property Value

string

Inherited From ServiceBusMessage.replyToSessionId

scheduledEnqueueTimeUtc

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. This value is for delayed message sending. It is utilized to delay messages sending to a specific time in the future. Message enqueuing time does not mean that the message will be sent at the same time. It will get enqueued, but the actual sending time depends on the queue's workload and its state.

scheduledEnqueueTimeUtc?: Date

Property Value

Date

Inherited From ServiceBusMessage.scheduledEnqueueTimeUtc

sessionId

The session identifier for a session-aware entity. Maximum length is 128 characters. For session-aware entities, this application-defined value specifies the session affiliation of the message. Messages with the same session identifier are subject to summary locking and enable exact in-order processing and demultiplexing. For session-unaware entities, this value is ignored. Message Sessions.

sessionId?: string

Property Value

string

Inherited From ServiceBusMessage.sessionId

subject

The application specific label. This property enables the application to indicate the purpose of the message to the receiver in a standardized. fashion, similar to an email subject line. The mapped AMQP property is "subject".

subject?: string

Property Value

string

Inherited From ServiceBusMessage.subject

timeToLive

The message’s time to live value. This value is the relative duration after which the message expires, starting from the instant the message has been accepted and stored by the broker, as captured in enqueuedTimeUtc. When not set explicitly, the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level timeToLive value cannot be longer than the entity's DefaultTimeToLive setting and it is silently adjusted if it does. See Expiration.

timeToLive?: number

Property Value

number

Inherited From ServiceBusMessage.timeToLive

to

The "to" address. This property is reserved for future use in routing scenarios and presently ignored by the broker itself. Applications can use this value in rule-driven auto-forward chaining scenarios to indicate the intended logical destination of the message.

to?: string

Property Value

string

Inherited From ServiceBusMessage.to