Package version:
Path of the entity for which the receiver has been created.
A name used to identify the receiver. This can be used to correlate logs and exceptions. If not specified or empty, a random unique one will be generated.
Readonly isReturns true if either the receiver or the client that created it has been closed.
The receive mode used to create the receiver.
Readonly sessionThe session ID.
Readonly sessionThe time in UTC until which the session is locked.
Every time renewSessionLock() is called, this time gets updated to current time plus the lock
duration as specified during the Queue/Subscription creation.
Will return undefined until a AMQP receiver link has been successfully set up for the session.
The lock held on the message by the receiver is let go, making the message available again in Service Bus for another receive operation.
Optional propertiesToModify: { The properties of the message to modify while abandoning the message.
ServiceBusError with the code SessionLockLost (for messages from a Queue/Subscription with sessions enabled)
if the AMQP link with which the message was received is no longer alive. This can
happen either because the lock on the session expired or the receiver was explicitly closed by
the user or the AMQP link is closed by the library due to network loss or service error.
ServiceBusError with the code MessageLockLost (for messages from a Queue/Subscription with sessions not enabled)
if the lock on the message has expired or the AMQP link with which the message was received is
no longer alive. The latter can happen if the receiver was explicitly closed by the user or the
AMQP link got closed by the library due to network loss or service error.
Error if the message is already settled. property on the message if you are not sure whether the message is settled.
Error if used in receiveAndDelete mode because all messages received in this mode
are pre-settled. To avoid this error, update your code to not settle a message which is received
in this mode.
ServiceBusError with the code ServiceTimeout if Service Bus does not acknowledge the request to settle
the message in time. The message may or may not have been settled successfully.
Removes the message from Service Bus.
Error with name SessionLockLostError (for messages from a Queue/Subscription with sessions enabled)
if the AMQP link with which the message was received is no longer alive. This can
happen either because the lock on the session expired or the receiver was explicitly closed by
the user or the AMQP link is closed by the library due to network loss or service error.
Error with name MessageLockLostError (for messages from a Queue/Subscription with sessions not enabled)
if the lock on the message has expired or the AMQP link with which the message was received is
no longer alive. The latter can happen if the receiver was explicitly closed by the user or the
AMQP link got closed by the library due to network loss or service error.
Error if the message is already settled. property on the message if you are not sure whether the message is settled.
Error if used in receiveAndDelete mode because all messages received in this mode
are pre-settled. To avoid this error, update your code to not settle a message which is received
in this mode.
Error with name ServiceUnavailableError if Service Bus does not acknowledge the request to settle
the message in time. The message may or may not have been settled successfully.
Moves the message to the deadletter sub-queue. To receive a deadletted message, create a new QueueClient/SubscriptionClient using the path for the deadletter sub-queue.
Optional options: DeadLetterOptions & { The DeadLetter options that can be provided while rejecting the message.
ServiceBusError with the code SessionLockLost (for messages from a Queue/Subscription with sessions enabled)
if the AMQP link with which the message was received is no longer alive. This can
happen either because the lock on the session expired or the receiver was explicitly closed by
the user or the AMQP link is closed by the library due to network loss or service error.
ServiceBusError with the code MessageLockLost (for messages from a Queue/Subscription with sessions not enabled)
if the lock on the message has expired or the AMQP link with which the message was received is
no longer alive. The latter can happen if the receiver was explicitly closed by the user or the
AMQP link got closed by the library due to network loss or service error.
Error if the message is already settled. property on the message if you are not sure whether the message is settled.
Error if used in receiveAndDelete mode because all messages received in this mode
are pre-settled. To avoid this error, update your code to not settle a message which is received
in this mode.
ServiceBusError with the code ServiceTimeout if Service Bus does not acknowledge the request to settle
the message in time. The message may or may not have been settled successfully.
Defers the processing of the message. Save the sequenceNumber of the message, in order to
receive it message again in the future using the receiveDeferredMessage method.
Optional propertiesToModify: { The properties of the message to modify while deferring the message
ServiceBusError with the code SessionLockLost (for messages from a Queue/Subscription with sessions enabled)
if the AMQP link with which the message was received is no longer alive. This can
happen either because the lock on the session expired or the receiver was explicitly closed by
the user or the AMQP link is closed by the library due to network loss or service error.
ServiceBusError with the code MessageLockLost (for messages from a Queue/Subscription with sessions not enabled)
if the lock on the message has expired or the AMQP link with which the message was received is
no longer alive. The latter can happen if the receiver was explicitly closed by the user or the
AMQP link got closed by the library due to network loss or service error.
Error if the message is already settled. property on the message if you are not sure whether the message is settled.
Error if used in receiveAndDelete mode because all messages received in this mode
are pre-settled. To avoid this error, update your code to not settle a message which is received
in this mode.
ServiceBusError with the code ServiceTimeout if Service Bus does not acknowledge the request to settle
the message in time. The message may or may not have been settled successfully.
Returns an iterator that can be used to receive messages from Service Bus.
Optional options: GetMessageIteratorOptionsA set of options to control the receive operation.
abortSignal: The signal to use to abort the ongoing operation.Error if the underlying connection, client or receiver is closed.
Error if current receiver is already in state of receiving messages.
ServiceBusError if the service returns an error while receiving messages.
Gets the state of the Session. For more on session states, see Session State
Optional options: OperationOptionsBaseOptions bag to pass an abort signal or tracing options.
The state of that session
Error if the underlying connection or receiver is closed.
ServiceBusError if the service returns an error while retrieving session state.
Peek the next batch of active messages (including deferred but not deadlettered messages) on the queue or subscription without modifying them.
peekMessages() fetches the first active message. Each subsequent call fetches the
subsequent message.Completed/Abandoned/Deferred/Deadlettered.The maximum number of messages to peek.
Optional options: PeekMessagesOptionsOptions that allow to specify the maximum number of messages to peek, the sequenceNumber to start peeking from or an abortSignal to abort the operation.
Returns a promise that resolves to an array of deferred messages identified by given sequenceNumbers.
The sequence number or an array of sequence numbers for the messages that need to be received.
Optional options: OperationOptionsBaseOptions bag to pass an abort signal or tracing options.
A list of messages identified by the given sequenceNumbers or an empty list if no messages are found.
Error if the underlying connection or receiver is closed.
ServiceBusError if the service returns an error while receiving deferred messages.
Returns a promise that resolves to an array of messages received from Service Bus.
The maximum number of messages to receive.
Optional options: ReceiveMessagesOptionsA set of options to control the receive operation.
maxWaitTimeInMs: The maximum time to wait for the first message before returning an empty array if no messages are available.abortSignal: The signal to use to abort the ongoing operation.A promise that resolves with an array of messages.
Error if the underlying connection, client or receiver is closed.
Error if current receiver is already in state of receiving messages.
ServiceBusError if the service returns an error while receiving messages.
Renews the lock on the message for the duration as specified during the Queue/Subscription creation.
lockedUntilUtc property on the message for the time when the lock expires.complete(), defer() or deadletter(),
before its lock expires, then the message lands back in the Queue/Subscription for the next
receive operation.New lock token expiry date and time in UTC format.
Error if the underlying connection, client or receiver is closed.
ServiceBusError if the service returns an error while renewing message lock.
Renews the lock on the session.
Optional options: OperationOptionsBaseSets the state on the Session. For more on session states, see Session State
The state that needs to be set.
Optional options: OperationOptionsBaseOptions bag to pass an abort signal or tracing options.
Error if the underlying connection or receiver is closed.
ServiceBusError if the service returns an error while setting the session state.
Streams messages to message handlers.
A handler that gets called for messages and errors.
Optional options: SubscribeOptionsOptions for subscribe.
An object that can be closed, sending any remaining messages to handlers and
stopping new messages from arriving.
Generated using TypeDoc
A receiver that handles sessions, including renewing the session lock.