rabbit-lib-node
v1.1.3
Published
A simple abstraction from amqplib
Downloads
19
Readme
Rabbit Lib Node
This library abstracts the amqplib layers and can work with a cleaner code.
Exemplo Methods
- consumer
- publisher
- rpcRabbit
- rpcPublisher
How to Install
npm install --save rabbit-lib-node
Usage
This session will show you how to use the library:
How to import
const Rabbit = require('rabbit-lib-node');
Consumer Example
new Rabbit({ callback: (msg) => {
console.log(msg)
}, address: 'amqp://guest:guest@localhost:5672',
q: 'queue.topic' }).consumer()
Publisher Example
new Rabbit({
address: 'amqp://guest:guest@localhost:5672',
q: 'queue.topic' }).publisher({...})
RPC Consumer Example
new Rabbit({ callback: (msg) => {
console.log(msg)
}, address: 'amqp://guest:guest@localhost:5672',
q: 'queue.topic' }).rpcRabbit()
RPC Publisher Example
new Rabbit({ callback: (msg) => {
console.log(msg)
}, address: 'amqp://guest:guest@localhost:5672',
q: 'queue.topic' }).rpcPublisher({...})