Microsoft Azure Service Bus Client Library for Python providing comprehensive messaging capabilities for enterprise applications.
Overall
score
92%
A utility module for building Azure Service Bus messages with rich metadata and properties for a notification system.
The module provides a function to build notification messages with appropriate routing and identification properties.
The module supports adding custom metadata to messages via application properties.
The module supports setting time-based properties for message lifecycle management.
The module supports session-based messaging for ordered processing.
@generates
from typing import Dict, Any, Optional
from datetime import datetime, timedelta
from azure.servicebus import ServiceBusMessage
def build_notification_message(
notification_data: Dict[str, Any],
time_to_live: Optional[int] = None,
scheduled_time: Optional[datetime] = None
) -> ServiceBusMessage:
"""
Build a Service Bus message from notification data with appropriate properties.
Args:
notification_data: Dictionary containing:
- type: str - notification type (e.g., "email", "sms")
- recipient: str - recipient identifier
- content: str - notification content
- notification_id: str - unique notification identifier
- priority: Optional[str] - priority level
- tags: Optional[List[str]] - tags for categorization
- session_id: Optional[str] - session identifier for ordered processing
- reply_to_session_id: Optional[str] - reply-to session identifier
time_to_live: Optional time-to-live in seconds
scheduled_time: Optional scheduled delivery time
Returns:
ServiceBusMessage with all properties configured
"""
passProvides Azure Service Bus messaging client and message types.
@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