---
name: role-backend-message-queues-c78c78ed872b
description: |
  Implements message queue systems using RabbitMQ, Apache Kafka, Redis Streams, AWS SQS/SNS,
  and Google Pub/Sub. Covers topics, exchanges, dead letter queues, idempotency, ordering
  guarantees, consumer groups, backpressure handling, and message serialization.
  Use when setting up async communication, event-driven architectures, or decoupling services.
allowed-tools: Read, Grep, Glob, Bash
---

# Message Queues

## When to use
- Choosing between RabbitMQ, Kafka, Redis Streams, SQS, or Pub/Sub for a new integration
- Designing RabbitMQ exchange topology (direct, topic, fanout, headers)
- Designing Kafka topic partitioning and consumer group structure
- Implementing idempotent consumers that handle duplicate delivery safely
- Setting up dead letter queues and replay tooling for failed messages
- Enforcing ordering guarantees without sacrificing throughput
- Managing backpressure between fast producers and slow consumers
- Choosing message serialization format (JSON vs Avro vs Protobuf)

## Core principles
1. **At-least-once is the default** — every consumer must be idempotent; duplicates will arrive
2. **Partition key determines order** — group messages by entity ID, not randomly
3. **DLQ depth is never acceptable as a steady state** — it means something is broken
4. **Schema versioning from day one** — breaking changes without a registry are production incidents waiting to happen
5. **Consumer lag is the real SLA** — not throughput; lag tells you whether processing keeps pace with production

## Reference Files

- `references/brokers-patterns.md` — technology selection table with ordering and delivery guarantees, RabbitMQ exchange types and configuration, Kafka topic design and consumer group rules, and schema registry with Avro/Protobuf guidance
- `references/reliability-patterns.md` — DLQ setup and retention policy, idempotent consumer implementation with idempotency table SQL, ordering guarantees and retry trade-offs, backpressure techniques, message serialization format selection, and claim-check pattern for oversized payloads


---
Source attribution: rnavarych
Original project: https://github.com/rnavarych/alpha-engineer/blob/c5b74102c7fd584af3d344ba7c331a7bbec3c729/plugins/roles/role-backend/skills/message-queues/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Raman Navarych

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: rnavarych
Original project: https://github.com/rnavarych/alpha-engineer/blob/c5b74102c7fd584af3d344ba7c331a7bbec3c729/plugins/roles/role-backend/skills/message-queues/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, DevOps / SRE
Specialties: Backend
Tools: Rabbitmq, Apache Kafka, Aws Sqs/Sns, Redis Streams, Google Pub/Sub
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 551b515f0843cbe417018240e7a8fdb32049ff8e62dcc1a5225fcb52ea3742d6
