MQueue adapter for rhea AMQP v1.0
npm install @mqueue/rheaAn rhea adapter (AMQP v1.0) for
MQueue,
adding support for rhea queues with a multi-backend setup with MQueue.
``bash`
npm install --save @mqueue/queue @mqueue/rheaor use pnpm/yarn
`ts
import MQueue from "@mqueue/queue"; // or require("@mqueue/queue");
import { RheaQueue } from "@mqueue/rhea"; // or require("@mqueue/rhea");
const outgoingQueue = new MQueue.Outgoing(
await RheaQueue.Outgoing.connect("amqp://rabbitmq:5271", "queue-name"),
);
outgoingQueue.sendMessage({
headers: {
"Account-ID": "123",
},
body: "...",
});
// ...
const incomingQueue = new MQueue.Incoming(
await RheaQueue.Incoming.connect("amqp://rabbitmq:5271", "queue-name"),
);
// Start listening to the queue
await incomingQueue.consume(async (payload) => {
const topicOrQueueName = payload.transport.name;
const headers = payload.message.headers;
const data = await payload.message.json();
await payload.accept(); // or await payload.reject();
// ...
});
``
- RabbitMQ v4 and later
- RabbitMQ v3 and earler, with the AMQP v1.0 plugin
- Apache ActiveMQ
- Azure Service Bus -
Note: identity and authentication is easier with the
dedicated Azure Service Bus queue adapter