Microsoft Azure Service Bus Client Library for Python providing comprehensive messaging capabilities for enterprise applications.
Overall
score
92%
A utility for efficiently sending large volumes of messages to Azure Service Bus queues using batch operations.
@generates
class MessageBatchProcessor:
"""Processes and sends messages to Azure Service Bus queues using batches."""
def __init__(self, connection_string: str, queue_name: str):
"""
Initialize the batch processor.
Args:
connection_string: Azure Service Bus connection string
queue_name: Name of the queue to send messages to
"""
pass
def create_batch(self, max_size_in_bytes: int = 50000):
"""
Create a new message batch with specified maximum size.
Args:
max_size_in_bytes: Maximum batch size in bytes (default: 50000)
Returns:
A message batch object that can accept messages
"""
pass
def add_message_to_batch(self, batch, message_body: str) -> bool:
"""
Add a message to an existing batch.
Args:
batch: The batch to add the message to
message_body: The message content as a string
Returns:
True if message was added successfully, False if batch is full
"""
pass
def send_batch(self, batch) -> None:
"""
Send a batch of messages to the configured queue.
Args:
batch: The batch to send
"""
pass
def send_messages_in_batches(self, message_bodies: list[str]) -> int:
"""
Send a list of messages by automatically creating and sending batches.
Args:
message_bodies: List of message content strings
Returns:
Number of batches sent
"""
pass
def close(self) -> None:
"""Close the processor and release resources."""
passProvides Azure Service Bus messaging capabilities including batch operations.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-azure-servicebusdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10