Class ServiceBusConnection
- Namespace
- Microsoft.Azure.ServiceBus
- Assembly
- Microsoft.Azure.ServiceBus.dll
Connection object to service bus namespace
public class ServiceBusConnection
- Inheritance
-
ServiceBusConnection
- Inherited Members
Constructors
ServiceBusConnection(ServiceBusConnectionStringBuilder)
Creates a new connection to service bus.
public ServiceBusConnection(ServiceBusConnectionStringBuilder connectionStringBuilder)
Parameters
connectionStringBuilder
ServiceBusConnectionStringBuilderServiceBusConnectionStringBuilder having namespace information.
Remarks
It is the responsibility of the user to close the connection after use through CloseAsync()
ServiceBusConnection(string)
Creates a new connection to service bus.
public ServiceBusConnection(string namespaceConnectionString)
Parameters
namespaceConnectionString
stringNamespace connection string
Remarks
It is the responsibility of the user to close the connection after use through CloseAsync()
ServiceBusConnection(string, TransportType, RetryPolicy)
Creates a new connection to service bus.
public ServiceBusConnection(string endpoint, TransportType transportType, RetryPolicy retryPolicy = null)
Parameters
endpoint
stringFully qualified domain name for Service Bus. Most likely, {yournamespace}.servicebus.windows.net
transportType
TransportTypeTransport type.
retryPolicy
RetryPolicyRetry policy for operations. Defaults to Default
ServiceBusConnection(string, TimeSpan, RetryPolicy)
Creates a new connection to service bus.
public ServiceBusConnection(string namespaceConnectionString, TimeSpan operationTimeout, RetryPolicy retryPolicy = null)
Parameters
namespaceConnectionString
stringNamespace connection string.
operationTimeout
TimeSpanDuration after which individual operations will timeout.
retryPolicy
RetryPolicyRetry policy for operations. Defaults to Default
Remarks
It is the responsibility of the user to close the connection after use through CloseAsync()
Properties
Endpoint
Fully qualified domain name for Service Bus.
public Uri Endpoint { get; set; }
Property Value
- Uri
OperationTimeout
OperationTimeout is applied in erroneous situations to notify the caller about the relevant ServiceBusException
public TimeSpan OperationTimeout { get; set; }
Property Value
Remarks
Defaults to 1 minute.
RetryPolicy
Retry policy for operations performed on the connection.
public RetryPolicy RetryPolicy { get; set; }
Property Value
Remarks
Defaults to Default
TokenProvider
Token provider for authentication. TokenProvider
public ITokenProvider TokenProvider { get; set; }
Property Value
TransportType
Get the transport type from the connection string.
public TransportType TransportType { get; set; }
Property Value
Methods
CloseAsync()
Closes the connection.
public Task CloseAsync()