feathers-rabbit-queue
A Feathers amqp service adapter for Rabbit Queue.
$ npm install --save feathers-rabbit-queue
API
configure(options)
Configure RabbitMQ with Feathers application as new provider.
Options:
uri
(required) - Connection uri to RabbitMQprefetch
(optional, default:1
) - Prefetch from queueprefix
(optional) - Prefix all queues with an application namesocketOptions
(optional, default:{}
) - Socket Options will be passed as a second param to amqp.connect and from there to the socket library (net or tls)queue
(optional, default:{retries: 3, retryDelay: 1000, logEnabled: true}
) - Queue optionsreconnectDelay
(optional, default:1000
) - Delay before next reconnect attemptlogger
(optional, default:console
) - Output logger
Example
Here's a example of configuration.
const compress = ;const helmet = ;const cors = ; const feathers = ;const configuration = ;const express = ;const rabbitConfigure = configure; const app = ; // Load app configurationapp;// Enable security, CORS, compression, favicon and body parsingapp;app;app;app;app; // Set up Plugins and providersapp;app; // Configure a middleware for 404s and the error handlerapp;app;
Send custom message through RabbitMQ.
Create
{ try const result = await apprabbit; console; catch error console; }
Patch
{ try const result = await apprabbit; console; catch error console; }
Remove
{ try const result = await apprabbit; console; catch error console; }
Message can be send to another Queue.
{ try const result = await apprabbit; console; catch error console; }