Typed queues, messaging, pub/sub & streams. Without losing what makes each broker special.
One consistent lifecycle and message model for BullMQ, Kafka, RabbitMQ, Redis, NATS, and SQS — with provider-native options, responses, and acknowledgements preserved through the types.
Install once, add only the SDK you use
npm install @mohamedhabibwork/queuekit kafkajsEvery broker SDK is an optional peer dependency. If one is missing, QueueKit throws a QueueConfigError with the exact install command.
Quick start
import { createQueue } from '@mohamedhabibwork/queuekit';
const kafka = await createQueue({
type: 'kafka',
clientId: 'orders-api',
brokers: ['localhost:9092'],
});
await kafka.publish('orders.created', {
payload: { orderId: 'ord_123' },
}, {
native: { partition: 2, headers: { source: 'api' } },
});Provider-native options live under native: BullMQ options can never be accidentally passed to Kafka, and vice versa.
Providers
BullMQ
Delayed, retried, prioritized jobs on Redis.
Event streamKafka
Partitions, consumer groups, offset commits.
Message queueRabbitMQ
Ack / nack / reject, priority, TTL, dead letters.
Pub/Sub or streamRedis
Pub/Sub fan-out or Streams with consumer groups.
Pub/SubNATS
Core pub/sub and queue groups; JetStream publishing.
Message queueAmazon SQS
Visibility timeouts, delays, FIFO deduplication.
Why it looks like this
Capabilities, not illusions
A provider advertises only what its broker really supports. Kafka partitions never masquerade as priority.
Native types flow through
Options, publish results, incoming messages, and acknowledgements keep their provider-native types.
In-memory fake driver
Deterministic delivery, delays, retries, and dead letters with waitUntilIdle() and flush() controls.
Runtime-neutral core
The core never imports a broker SDK and runs on Node 20+, Bun, and Deno 2+.
capabilities, provider-native configuration, and idempotent consumers. message.metadata is application-only and is never sent to a broker.