Closes the underlying AMQP receiver link.
Once closed, the receiver cannot be used for any further operations.
Use the createReceiver
function on the QueueClient or SubscriptionClient to instantiate
a new Receiver
Gets an async iterator over messages from the receiver.
Throws an error if there is another receive operation in progress on the same receiver. If you
are not sure whether there is another receive operation running, check the isReceivingMessages
property on the receiver.
If the iterator is not able to fetch a new message in over a minute, undefined
will be returned.
Indicates whether the receiver is currently receiving messages or not.
When this returns true, new registerMessageHandler()
or receiveMessages()
calls cannot be made.
Returns a promise that resolves to a deferred message identified by the given sequenceNumber
.
The sequence number of the message that needs to be received.
Promise<ServiceBusMessage | undefined>
Message
identified by sequence number.undefined
if no such message is found.Returns a promise that resolves to an array of deferred messages identified by given sequenceNumbers
.
An array of sequence numbers for the messages that need to be received.
Promise<ServiceBusMessage[]>
Returns a promise that resolves to an array of messages based on given count and timeout over an AMQP receiver link from a Queue/Subscription.
Throws an error if there is another receive operation in progress on the same receiver. If you
are not sure whether there is another receive operation running, check the isReceivingMessages
property on the receiver.
The maximum number of messages to receive from Queue/Subscription.
The total wait time in seconds until which the receiver will attempt to receive specified number of messages.
If this time elapses before the maxMessageCount
is reached, then messages collected till then will be returned to the user.
60
seconds.Promise<ServiceBusMessage[]> A promise that resolves with an array of Message objects.
Registers handlers to deal with the incoming stream of messages over an AMQP receiver link
from a Queue/Subscription.
To stop receiving messages, call close()
on the Receiver.
Throws an error if there is another receive operation in progress on the same receiver. If you
are not sure whether there is another receive operation running, check the isReceivingMessages
property on the receiver.
Handler for processing each incoming message.
Handler for any error that occurs while receiving or processing messages.
Options to control if messages should be automatically completed, and/or have their locks automatically renewed. You can control the maximum number of messages that should be concurrently processed. You can also provide a timeout in seconds to denote the amount of time to wait for a new message before closing the receiver.
void
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.The lockToken
property of the message or the message itself.
Promise
Generated using TypeDoc
The Receiver class can be used to receive messages in a batch or by registering handlers. Use the
createReceiver
function on the QueueClient or SubscriptionClient to instantiate a Receiver. The Receiver class is an abstraction over the underlying AMQP receiver link.