Creates an instance of the ServiceBusClient class which can be used to create senders and receivers to the Azure Service Bus namespace provided in the connection string. No connection is made to the service until the senders/receivers created with the client are used to send/receive messages.
A connection string for Azure Service Bus namespace. NOTE: this connection string can contain an EntityPath, which is ignored.
Options for the service bus client.
Creates an instance of the ServiceBusClient class which can be used to create senders and receivers to the Azure Service Bus namespace provided. No connection is made to the service until the senders/receivers created with the client are used to send/receive messages.
The full namespace of your Service Bus instance which is
likely to be similar to
A credential object used by the client to get the token to authenticate the connection
with the Azure Service Bus. See @azure/identity for creating the credentials.
If you're using an own implementation of the TokenCredential
interface against AAD, then set the "scopes" for service-bus
to be ["https://servicebus.azure.net//user_impersonation"]
to get the appropriate token.
Options for the service bus client.
The fully qualified namespace of the Service Bus instance for which this client is created.
This is likely to be similar to
Closes the underlying AMQP connection. NOTE: this will also disconnect any Receiver or Sender instances created from this instance.
Creates a receiver for an Azure Service Bus queue in peekLock mode. No connection is made to the service until one of the methods on the receiver is called.
To target sub queues like the dead letter queue or the transfer dead letter queue, provide the
subQueue
in the options. To learn more about dead letter queues, see
https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues
If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. In peekLock mode, the receiver has a lock on the message for the duration specified on the queue.
Messages that are not settled within the lock duration will be redelivered as many times as the max delivery count set on the queue, after which they get sent to a separate dead letter queue.
You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on the message.
More information about how peekLock and message settlement works here: https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
The name of the queue to receive from.
Options to pass the receiveMode, defaulted to peekLock.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessageWithLock
Creates a receiver for an Azure Service Bus queue in receiveAndDelete mode. No connection is made to the service until one of the methods on the receiver is called.
To target sub queues like the dead letter queue or the transfer dead letter queue, provide the
subQueue
in the options. To learn more about dead letter queues, see
https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues
If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
The name of the queue to receive from.
Options to pass the receiveMode, defaulted to receiveAndDelete.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessage
Creates a receiver for an Azure Service Bus subscription in peekLock mode. No connection is made to the service until one of the methods on the receiver is called.
To target sub queues like the dead letter queue or the transfer dead letter queue, provide the
subQueue
in the options. To learn more about dead letter queues, see
https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues
If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. In peekLock mode, the receiver has a lock on the message for the duration specified on the subscription.
Messages that are not settled within the lock duration will be redelivered as many times as the max delivery count set on the subscription, after which they get sent to a separate dead letter queue.
You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on the message.
More information about how peekLock and message settlement works here: https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
Name of the topic for the subscription we want to receive from.
Name of the subscription (under the topic
) that we want to receive from.
Options to pass the receiveMode, defaulted to peekLock.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessageWithLock
Creates a receiver for an Azure Service Bus subscription in receiveAndDelete mode. No connection is made to the service until one of the methods on the receiver is called.
To target sub queues like the dead letter queue or the transfer dead letter queue, provide the
subQueue
in the options. To learn more about dead letter queues, see
https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues
If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
Name of the topic for the subscription we want to receive from.
Name of the subscription (under the topic
) that we want to receive from.
Options to pass the receiveMode, defaulted to receiveAndDelete.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessage
Creates a Sender which can be used to send messages, schedule messages to be sent at a later time and cancel such scheduled messages. No connection is made to the service until one of the methods on the sender is called.
The name of a queue or topic to send messages to.
Creates a receiver for a session enabled Azure Service Bus queue in peekLock mode. If the receiveMode is not provided in the options, it defaults to the "peekLock" mode.
In peekLock mode, the receiver has a lock on the session for the duration specified on the queue.
Messages that are not settled within the lock duration will be redelivered as many times as the max delivery count set on the queue, after which they get sent to a separate dead letter queue.
You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on the message.
More information about how peekLock and message settlement works here: https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
The name of the queue to receive from.
Options include receiveMode(defaulted to peekLock), options to create session receiver.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessageWithLock
Creates a receiver for a session enabled Azure Service Bus queue in receiveAndDelete mode. If the receiveMode is not provided in the options, it defaults to the "peekLock" mode.
In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
The name of the queue to receive from.
Options include receiveMode(defaulted to receiveAndDelete), options to create session receiver.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessage
Creates a receiver for a session enabled Azure Service Bus subscription in peekLock mode. If the receiveMode is not provided in the options, it defaults to the "peekLock" mode.
In peekLock mode, the receiver has a lock on the session for the duration specified on the subscription.
Messages that are not settled within the lock duration will be redelivered as many times as the max delivery count set on the subscription, after which they get sent to a separate dead letter queue.
You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on the message.
More information about how peekLock and message settlement works here: https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
Name of the topic for the subscription we want to receive from.
Name of the subscription (under the topic
) that we want to receive from.
Options include receiveMode(defaulted to peekLock), options to create session receiver.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessageWithLock
Creates a receiver for a session enabled Azure Service Bus subscription in receiveAndDelete mode. If the receiveMode is not provided in the options, it defaults to the "peekLock" mode.
In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
Name of the topic for the subscription we want to receive from.
Name of the subscription (under the topic
) that we want to receive from.
Options include receiveMode(defaulted to receiveAndDelete), options to create session receiver.
A receiver that can be used to receive messages of the form ServiceBusReceivedMessage
Generated using TypeDoc
A client that can create Sender instances for sending messages to queues and topics as well as Receiver instances to receive messages from queues and subscriptions.