tessl install tessl/pypi-azure-servicebus@7.14.0Microsoft Azure Service Bus Client Library for Python providing comprehensive messaging capabilities for enterprise applications.
Agent Success
Agent success rate when using this tile
92%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.01x
Baseline
Agent success rate without this tile
91%
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