Microsoft Azure Service Bus Client Library for Python providing comprehensive messaging capabilities for enterprise applications.
Overall
score
92%
Build a message enrichment service that adds custom metadata annotations to messages before sending them to a queue.
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.
Implement a message sender that:
The solution should handle both sending messages with annotations and receiving messages to verify the annotations are accessible.
@generates
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
"""
passProvides Azure Service Bus messaging capabilities.
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