UNPKG

fastify-rabbitmq

Version:

A Fastify RabbitMQ Plugin Developed in Pure TypeScript.

27 lines (26 loc) 1.27 kB
import { FastifyInstance } from "fastify"; import { ConnectionOptions } from "rabbitmq-client"; import { FastifyRabbitMQOptions } from "./decorate.js"; export * from "./types.js"; declare const decorateFastifyInstance: (fastify: FastifyInstance, options: FastifyRabbitMQOptions, connection: any) => void; /** * Main Function * @since 1.0.0 * @example * This is the basics on how to use this plugin: * ```js * app.register(fastifyRabbit, { * connection: 'amqp://guest:guest@localhost' * }) * ``` * This will allow you to read from your Fastify "object" and * use this plugin at the "rabbitmq" level. From there you can execute and maintain * the RabbitMQ Connection using the 'rabbitmq-client' package, which is wrapping around * this plugin to execute functions it provides. * * @see [https://cody-greene.github.io/node-rabbitmq-client/latest/index.html](https://cody-greene.github.io/node-rabbitmq-client/latest/index.html) * */ declare const fastifyRabbit: import("fastify").FastifyPluginCallback<FastifyRabbitMQOptions, import("fastify").RawServerDefault, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>; export default fastifyRabbit; export { decorateFastifyInstance, FastifyRabbitMQOptions, ConnectionOptions };