| name | message-queues |
| description | Message queue patterns with RabbitMQ, Redis Streams, BullMQ, dead letter queues, exactly-once delivery, and event-driven architectures |
| layer | domain |
| category | backend |
| triggers | ["message queue","rabbitmq","redis streams","bullmq","bull","event driven","pub sub","dead letter queue","job queue","task queue","background jobs"] |
| inputs | ["Async processing requirements","Event-driven architecture needs","Job scheduling specifications"] |
| outputs | ["Queue topology designs","Producer/consumer implementations","Retry and dead letter configurations"] |
| linksTo | ["redis","microservices","nodejs","python","golang"] |
| linkedFrom | ["error-handling","logging","monitoring"] |
| preferredNextSkills | ["redis","microservices","nodejs"] |
| fallbackSkills | ["websockets","redis"] |
| riskLevel | low |
| memoryReadPolicy | selective |
| memoryWritePolicy | none |
| sideEffects | [] |
Message Queues Domain Skill
Purpose
Provide expert-level guidance on message queue patterns, including RabbitMQ exchange topologies, Redis Streams consumer groups, BullMQ job processing, dead letter queues, retry strategies, exactly-once semantics, and event-driven architecture design.
When to Use What
| Technology | Best For | Ordering | Persistence | Throughput |
|---|
| BullMQ | Job queues in Node.js apps | FIFO per queue | Redis-backed | High |
| Redis Streams | Event logs, lightweight pub/sub | Per-stream | Configurable | Very high |
| RabbitMQ | Complex routing, multi-consumer | Per-queue | Durable | High |
| Kafka | Event sourcing, high-volume streaming | Per-partition | Durable | Extreme |
| SQS | Serverless, AWS-native | Best-effort | Managed | High |
Key Patterns
1. BullMQ (Node.js)
import { Queue, Worker, QueueScheduler, FlowProducer } from 'bullmq';
import IORedis from 'ioredis';
const connection = new IORedis({
host: process.env.REDIS_HOST,
port: 6379,
maxRetriesPerRequest: null,
});
{
: ;
: ;
: ;
: <, >;
}
{
: ;
: ;
}
emailQueue = <, >(, {
connection,
: {
: ,
: {
: ,
: ,
},
: { : * },
: { : * * },
},
});
() {
emailQueue.(, data, {
: opts?.,
: opts?.,
: ,
});
}
emailWorker = <, >(
,
(job) => {
job.();
job.();
html = (job.., job..);
job.();
result = mailer.({
: job..,
: job..,
html,
});
job.();
{ : result., : ().() };
},
{
connection,
: ,
: {
: ,
: ,
},
}
);
emailWorker.(, {
logger.({ : job., result }, );
});
emailWorker.(, {
logger.({ : job?., : err., : job?. }, );
});
emailQueue.(, { : }, {
: {
: ,
: ,
},
});
flow = ({ connection });
flow.({
: ,
: ,
: { : },
: [
{ : , : , : { : } },
{ : , : , : { : } },
],
});