Skip to main content

Built and signed on GitHub Actions

AMQP/RabbitMQ driver for Fedify

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
4 weeks ago (0.1.0)
class AmqpMessageQueue
implements MessageQueue

A message queue that uses AMQP.

Examples

Example 1

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
});

Constructors

new
AmqpMessageQueue(
connection: Connection,
)

Creates a new AmqpMessageQueue.

Methods

enqueue(
message: any,
): Promise<void>
listen(
handler: (message: any) => void | Promise<void>,
): Promise<void>

Add Package

deno add jsr:@fedify/amqp

Import symbol

import { AmqpMessageQueue } from "@fedify/amqp/mq";

---- OR ----

Import directly with a jsr specifier

import { AmqpMessageQueue } from "jsr:@fedify/amqp/mq";

Add Package

npx jsr add @fedify/amqp

Import symbol

import { AmqpMessageQueue } from "@fedify/amqp/mq";

Add Package

yarn dlx jsr add @fedify/amqp

Import symbol

import { AmqpMessageQueue } from "@fedify/amqp/mq";

Add Package

pnpm dlx jsr add @fedify/amqp

Import symbol

import { AmqpMessageQueue } from "@fedify/amqp/mq";

Add Package

bunx jsr add @fedify/amqp

Import symbol

import { AmqpMessageQueue } from "@fedify/amqp/mq";