Note
Although it's theoretically possible to be used with any AMQP 0-9-1 broker, this package is primarily designed for and tested with RabbitMQ.
This package provides Fedify's MessageQueue
implementation for AMQP, which
is supported by RabbitMQ:
Here is an example of how to use it:
import { createFederation } from "@fedify/fedify";
import { AmqpMessageQueue } from "@fedify/amqp";
import { connect } from "amqplib";
const federation = createFederation({
queue: new AmqpMessageQueue(await connect("amqp://localhost")),
// ... other configurations
});
The AmqpMessageQueue
constructor accepts options as the second
parameter, which can be used to configure the message queue:
new AmqpMessageQueue(await connect("amqp://localhost"), {
queue: "my_queue",
})
For more details, please refer to the docs of [AmqpMessageQueueOptions
].
[AmqpMessageQueueOptions
] https://jsr.io/@fedify/amqp/doc/mq/~/AmqpMessageQueueOptions
deno add @fedify/amqp
npm install @fedify/amqp
bun add @fedify/amqp
To be released.
-
Added
nativeRetrial
option toAmqpMessageQueueOptions
to enable native retrial of messages. -
The type of the
AmqpMessageQueue()
constructor's first parameter has been changed fromConnection
toChannelModel
.
Released on March 28, 2025.
-
Added
AmqpMessageQueue.enqueueMany()
method for efficiently enqueuing multiple messages at once. -
Updated @js-temporal/polyfill to 0.5.0 for Node.js and Bun. On Deno, there is no change because the polyfill is not used.
Initial release. Released on October 14, 2024.