AgentStack
SKILL verified MIT Self-run

Message Queues

skill-cosmicstack-labs-mercury-agent-skills-message-queues · by cosmicstack-labs

RabbitMQ, Kafka, SQS, pub/sub, competing consumers, dead letter queues, and event streaming

No reviews yet
0 installs
15 views
0.0% view→install

Install

$ agentstack add skill-cosmicstack-labs-mercury-agent-skills-message-queues

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Message Queues? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Message Queues

Design reliable message-driven systems.

Queue Types

| Queue | Persistence | Ordering | Use Case | |-------|------------|----------|----------| | RabbitMQ | Optional | Per queue | Task distribution, RPC | | Apache Kafka | Durable (disk) | Per partition | Event streaming, logs | | AWS SQS | Durable | Best effort (std) / Strict (FIFO) | Serverless decoupling | | Redis Pub/Sub | None | Per channel | Real-time notifications |

RabbitMQ Patterns

Work Queues (Competing Consumers)

Producer → Queue → Consumer 1
                 → Consumer 2
                 → Consumer 3
  • Messages distributed round-robin
  • Ack on success, nack on failure (requeue or DLQ)
  • Prefetch count controls concurrency

Pub/Sub (Exchange → Binding → Queue)

  • Fanout: broadcast to all queues
  • Direct: route by routing key
  • Topic: route by pattern (user.*, user.created)
  • Headers: route by header values

Kafka Patterns

Topics & Partitions

  • Messages within a partition are ordered
  • Partitions enable parallelism
  • Consumer group = one instance per partition

Producer

await producer.send({
  topic: 'order-events',
  messages: [{ key: orderId, value: JSON.stringify(order) }],
});

Consumer

await consumer.run({
  eachMessage: async ({ topic, partition, message }) => {
    await processOrder(message.value);
  },
});

Dead Letter Queues

  • Messages that can't be processed go to DLQ
  • Analyze DLQ periodically for systemic issues
  • DLQ messages can be replayed after fix
  • Set max retry count before DLQ

Best Practices

  • Idempotent consumers (same message processed twice = safe)
  • Monitor queue depth, consumer lag, error rate
  • Set message TTL to prevent infinite backlog
  • Use structured message schemas (Avro, Protobuf)
  • Test with network failures and consumer crashes

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.