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-8/

Message Annotation Service

Build a message enrichment service that adds custom metadata annotations to messages before sending them to a queue.

Background

You're building a message processing system where each message needs to be enriched with service-specific metadata (like processing hints, routing information, or tracing data) that should be preserved separately from the message body and application properties.

Requirements

Implement a message sender that:

  1. Creates messages with a text body
  2. Adds custom annotations to messages containing metadata such as:
    • A message priority level (integer)
    • A processing timestamp (datetime)
    • A routing hint (string)
  3. Sends the annotated messages to a queue
  4. Retrieves and verifies that the annotations were preserved on received messages

The solution should handle both sending messages with annotations and receiving messages to verify the annotations are accessible.

Implementation Notes

  • Use a queue for message delivery
  • The metadata should be added as message annotations, not as application properties
  • When receiving messages, demonstrate that you can access and read the annotation values
  • Handle message settlement appropriately after processing

Test Cases

  • Sending a message with integer, string, and timestamp annotations preserves all annotation values @test
  • Multiple messages can be sent with different annotation values and each preserves its own annotations @test

@generates

API

def send_annotated_message(connection_string: str, queue_name: str, body: str, annotations: dict) -> None:
    """
    Send a message with custom annotations to a queue.

    Args:
        connection_string: Service Bus connection string
        queue_name: Name of the target queue
        body: Message body content
        annotations: Dictionary of annotation key-value pairs to add to the message
    """
    pass

def receive_and_verify_annotations(connection_string: str, queue_name: str, expected_count: int) -> list:
    """
    Receive messages from a queue and extract their annotations.

    Args:
        connection_string: Service Bus connection string
        queue_name: Name of the queue to receive from
        expected_count: Number of messages to receive

    Returns:
        List of dictionaries containing the annotations from each received message
    """
    pass

Dependencies { .dependencies }

azure-servicebus { .dependency }

Provides Azure Service Bus messaging capabilities.