Simple queue interface with support for multiple backends. Keep your options open.
Note: This project is currently a Work in Progress. Its not ready for production use yet - make a contribution.
To learn how to use MQueue, check out the @mqueue/queue README. To learn
how to use a specific queue adapter, check out the README for that adapter under
Queue Adapters.
For queue and transport compatibility, see the compatibility table in the
@mqueue/queue README.
import MQueue from "@mqueue/queue";
// const MQueue = require("@mqueue/queue");
const outgoingQueue = new MQueue.Outgoing(
await AmqplibOutgoingQueue.connect("amqp://rabbitmq:5271", "queue-name"),
);
outgoingQueue.sendMessage({
headers: { "Account-ID": "123" },
body: "...",
});
// ...
const incomingQueue = new MQueue.Incoming(
await AmqplibIncomingQueue.connect("amqp://rabbitmq:5271", "queue-name"),
);For more usage examples, see the
@mqueue/queuereadme.
@mqueue/queue: Simple queue interface with support for multiple backends
@mqueue/amqplib: AMQP v0.9.1 queue adapter@mqueue/sqs: AWS Simple Queue Service (SQS) queue adapter@mqueue/rhea: AMQP v1.0 queue adapter@mqueue/azure-service-bus: Azure Service Bus queue adapter@mqueue/google-cloud-pubsub: Google Cloud Pub/Sub@mqueue/mqtt: MQTT Queue Adapter@mqueue/kafkajs: Kafka Queue Adapter@mqueue/stompjs: STOMP Queue Adapter@mqueue/fastq: Fastq In-Memory Queue Adapter
@mqueue/multicast: Multi-queue simultaneous publishing/consumption strategy
This package was inspired by Keyv, Flystorage, and Flysystem.
The concept for this package was to create the Keyv for Queue backends - simply abstracting the interface for different queue backends to remain flexible and keep options open.