ServiceBusClient Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The ServiceBusClient is the top-level client through which all Service Bus entities can be interacted with. Any lower level types retrieved from here, such as ServiceBusSender and ServiceBusReceiver will share the same AMQP connection. Disposing the ServiceBusClient will cause the AMQP connection to close.
public class ServiceBusClient : IAsyncDisposable
type ServiceBusClient = class
interface IAsyncDisposable
Public Class ServiceBusClient
Implements IAsyncDisposable
- Inheritance
-
System.ObjectServiceBusClient
- Implements
-
System.IAsyncDisposable
Constructors
ServiceBusClient() |
Can be used for mocking. |
ServiceBusClient(String) |
Initializes a new instance of the ServiceBusClient class. |
ServiceBusClient(String, AzureNamedKeyCredential, ServiceBusClientOptions) |
Initializes a new instance of the ServiceBusClient class. |
ServiceBusClient(String, AzureSasCredential, ServiceBusClientOptions) |
Initializes a new instance of the ServiceBusClient class. |
ServiceBusClient(String, ServiceBusClientOptions) |
Initializes a new instance of the ServiceBusClient class. |
ServiceBusClient(String, TokenCredential) |
Initializes a new instance of the ServiceBusClient class. |
ServiceBusClient(String, TokenCredential, ServiceBusClientOptions) |
Initializes a new instance of the ServiceBusClient class. |
Properties
FullyQualifiedNamespace |
The fully qualified Service Bus namespace that the connection is associated with. This is likely
to be similar to |
IsClosed |
Indicates whether or not this ServiceBusClient has been closed. |
TransportType |
The transport type used for this ServiceBusClient. |
Methods
AcceptNextSessionAsync(String, ServiceBusSessionReceiverOptions, CancellationToken) |
Creates a ServiceBusSessionReceiver instance that can be used for receiving and settling messages from a specific session-enabled queue. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
AcceptNextSessionAsync(String, String, ServiceBusSessionReceiverOptions, CancellationToken) |
Creates a ServiceBusSessionReceiver instance that can be used for receiving and settling messages from a specific session-enabled subscription. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
AcceptSessionAsync(String, String, ServiceBusSessionReceiverOptions, CancellationToken) |
Creates a ServiceBusSessionReceiver instance that can be used for receiving and settling messages from a specific session-enabled queue. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
AcceptSessionAsync(String, String, String, ServiceBusSessionReceiverOptions, CancellationToken) |
Creates a ServiceBusSessionReceiver instance that can be used for receiving and settling messages from a specific session-enabled subscription. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
CreateProcessor(String) |
Creates a ServiceBusProcessor instance that can be used to process messages using event handlers that are set on the processor. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. If you want to change the ServiceBusReceiveMode, use CreateProcessor(String, ServiceBusProcessorOptions) method. The ServiceBusReceiveMode is set in ServiceBusProcessorOptions type. |
CreateProcessor(String, ServiceBusProcessorOptions) |
Creates a ServiceBusProcessor instance that can be used to process messages using event handlers that are set on the processor. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusProcessorOptions type. |
CreateProcessor(String, String) |
Creates a ServiceBusProcessor instance that can be used to process messages using event handlers that are set on the processor. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. If you want to change the ServiceBusReceiveMode, use CreateProcessor(String, String, ServiceBusProcessorOptions) method. The ServiceBusReceiveMode is set in ServiceBusProcessorOptions type. |
CreateProcessor(String, String, ServiceBusProcessorOptions) |
Creates a ServiceBusProcessor instance that can be used to process messages using event handlers that are set on the processor. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusProcessorOptions type. |
CreateReceiver(String) |
Creates a ServiceBusReceiver instance that can be used for receiving and settling messages from a specific queue. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. If you want to change the ServiceBusReceiveMode, use CreateReceiver(String, ServiceBusReceiverOptions) method. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
CreateReceiver(String, ServiceBusReceiverOptions) |
Creates a ServiceBusReceiver instance that can be used for receiving and settling messages from a specific queue. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
CreateReceiver(String, String) |
Creates a ServiceBusReceiver instance that can be used for receiving and settling messages from a specific subscription. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. If you want to change the ServiceBusReceiveMode, use CreateReceiver(String, String, ServiceBusReceiverOptions) method. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
CreateReceiver(String, String, ServiceBusReceiverOptions) |
Creates a ServiceBusReceiver instance that can be used for receiving and settling messages from a specific subscription. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusReceiverOptions. |
CreateSender(String) |
Creates a ServiceBusSender instance that can be used for sending messages to a specific queue or topic. |
CreateSessionProcessor(String, ServiceBusSessionProcessorOptions) |
Creates a ServiceBusSessionProcessor instance that can be used to process session messages using event handlers that are set on the processor. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusProcessorOptions type. |
CreateSessionProcessor(String, String, ServiceBusSessionProcessorOptions) |
Creates a ServiceBusSessionProcessor instance that can be used to process messages using event handlers that are set on the processor. It uses ServiceBusReceiveMode to specify how messages are received. Defaults to PeekLock mode. The ServiceBusReceiveMode is set in ServiceBusProcessorOptions type. |
DisposeAsync() |
Performs the task needed to clean up resources used by the ServiceBusClient, including ensuring that the client itself has been closed. |