servicebus Package

Packages

aio
amqp
management

Modules

exceptions

Classes

AutoLockRenewer

Auto renew locks for messages and sessions using a background thread pool.

Auto renew locks for messages and sessions using a background thread pool. It is recommended setting max_worker to a large number or passing ThreadPoolExecutor of large max_workers number when AutoLockRenewer is supposed to deal with multiple messages or sessions simultaneously.

ServiceBusClient

The ServiceBusClient class defines a high level interface for getting ServiceBusSender and ServiceBusReceiver.

ServiceBusConnectionStringProperties

Properties of a connection string.

ServiceBusMessage

A Service Bus Message.

ServiceBusMessageBatch

A batch of messages.

Sending messages in a batch is more performant than sending individual message. ServiceBusMessageBatch helps you create the maximum allowed size batch of Message to improve sending performance.

Use the add method to add messages until the maximum batch size limit in bytes has been reached - at which point a MessageSizeExceededError will be raised.

Please use the create_message_batch method of ServiceBusSender to create a ServiceBusMessageBatch object instead of instantiating a ServiceBusMessageBatch object directly.

ServiceBusReceivedMessage

A Service Bus Message received from service side.

ServiceBusReceiver

The ServiceBusReceiver class defines a high level interface for receiving messages from the Azure Service Bus Queue or Topic Subscription.

The two primary channels for message receipt are receive() to make a single request for messages, and for message in receiver: to continuously receive incoming messages in an ongoing fashion.

Please use the get_<queue/subscription>_receiver method of ~azure.servicebus.ServiceBusClient to create a ServiceBusReceiver instance.

ServiceBusSender

The ServiceBusSender class defines a high level interface for sending messages to the Azure Service Bus Queue or Topic.

Please use the get_<queue/topic>_sender method of ~azure.servicebus.ServiceBusClient to create a ServiceBusSender instance.

ServiceBusSession

The ServiceBusSession is used for manage session states and lock renewal.

Please use the property session on the ServiceBusReceiver to get the corresponding ServiceBusSession object linked with the receiver instead of instantiating a ServiceBusSession object directly.

Enums

ServiceBusMessageState
ServiceBusReceiveMode
ServiceBusSessionFilter
ServiceBusSubQueue
TransportType

Transport type The underlying transport protocol type:

Amqp: AMQP over the default TCP transport protocol, it uses port 5671. AmqpOverWebsocket: Amqp over the Web Sockets transport protocol, it uses port 443.

Functions

parse_connection_string

Parse the connection string into a properties bag containing its component parts.

parse_connection_string(conn_str: str) -> ServiceBusConnectionStringProperties

Parameters

Name Description
conn_str
Required
str

The connection string that has to be parsed.

Returns

Type Description

A properties model containing the parsed connection string.