tessl install tessl/pypi-gcloud@0.7.0Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
78%
Build a robust message processing system that handles messages from a queue with automatic retry and failure handling capabilities. Your system should process messages reliably and automatically route messages that repeatedly fail to a separate failure handling mechanism.
@generates
class MessageProcessor:
"""Handles message processing with dead letter queue support."""
def __init__(self, project_id, primary_topic_name, dead_letter_topic_name):
"""Initialize the message processor with project and topic names."""
pass
def setup_infrastructure(self, max_delivery_attempts=5):
"""
Create topics and configure subscription with dead letter handling.
Args:
max_delivery_attempts: Number of delivery attempts before moving to dead letter queue
"""
pass
def process_message(self, message_data):
"""
Process a single message from the primary subscription.
Returns:
True if message was processed successfully, False otherwise
"""
pass
def get_dead_letter_messages(self, max_messages=10):
"""
Retrieve messages from the dead letter subscription.
Returns:
List of messages that failed processing
"""
passProvides Google Cloud Pub/Sub messaging capabilities with dead letter queue support.