| name | messaging |
| description | Message queues and event-driven backend architecture. RabbitMQ, Kafka, pub/sub patterns, and async communication. |
| sasmp_version | 2.0.0 |
| bonded_agent | 04-architecture-patterns |
| bond_type | SECONDARY_BOND |
| atomic_operations | ["QUEUE_SETUP","EVENT_PUBLISHING","CONSUMER_CONFIGURATION","DLQ_HANDLING"] |
| parameter_validation | {"query":{"type":"string","required":true,"minLength":5,"maxLength":2000},"broker":{"type":"string","enum":["rabbitmq","kafka","redis","sqs"],"required":false}} |
| retry_logic | {"max_attempts":3,"backoff":"exponential","initial_delay_ms":1000} |
| logging_hooks | {"on_invoke":"skill.messaging.invoked","on_success":"skill.messaging.completed","on_error":"skill.messaging.failed"} |
| exit_codes | {"SUCCESS":0,"INVALID_INPUT":1,"CONNECTION_ERROR":2} |
Messaging & Event-Driven Skill
Bonded to: architecture-patterns-agent (Secondary)
Quick Start
"Set up RabbitMQ for my microservices"
"Implement event-driven order processing"
"Configure Kafka for high-throughput messaging"
Message Broker Comparison
| Broker | Best For | Throughput | Ordering |
|---|
| RabbitMQ | Task queues, RPC | Medium | Per queue |
| Kafka | Event streaming, logs | Very high | Per partition |
| Redis Pub/Sub | Real-time, simple | High | None |
| SQS | AWS serverless | Medium | FIFO optional |
Examples
RabbitMQ Producer/Consumer
import pika
import json
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='orders', durable=True)
def publish_order(order):
channel.basic_publish(
exchange='',
routing_key='orders',
body=json.dumps(order),
properties=pika.BasicProperties(delivery_mode=2)
)
def process_order(ch, method, properties, body):
order = json.loads(body)
print(f"Processing order: {order['id']}")
ch.basic_ack(delivery_tag=method.delivery_tag)
channel.basic_qos(prefetch_count=)
channel.basic_consume(queue=, on_message_callback=process_order)
channel.start_consuming()