or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-servicebus@7.14.x
tile.json

tessl/pypi-azure-servicebus

tessl install tessl/pypi-azure-servicebus@7.14.0

Microsoft 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%

task.mdevals/scenario-2/

Message Batch Processor

A utility for efficiently sending large volumes of messages to Azure Service Bus queues using batch operations.

Capabilities

Batch Creation and Management

  • Creates a message batch with a maximum size limit of 50000 bytes and returns a batch object @test
  • When adding messages "Message 1", "Message 2", and "Message 3" to a batch, all three are successfully added and the method returns True for each @test
  • When a batch is full, attempting to add another message returns False indicating the batch cannot accept more messages @test

Efficient Message Sending

  • When sending a batch containing 3 messages to a queue, all messages are successfully transmitted without errors @test
  • When processing a list of 10 messages where each batch can hold 3 messages, the system creates and sends 4 batches, returning the count of 4 @test

Implementation

@generates

API

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."""
        pass

Dependencies { .dependencies }

azure-servicebus { .dependency }

Provides Azure Service Bus messaging capabilities including batch operations.

@satisfied-by