AMQP Modern
A small amqplib
wrapper for nodejs that simplifies interactions with queue systems.
- Consuming a channel
- Async / Await based
- Publishing to a channel
- Passing off JS objects, so you don't have to
- It handles rejections and acknowledgments automatically
Install
npm install amqp-modern
Usage
import amqp from 'amqp-modern';
let client = amqp('amqp://connection string here');
client.config({
onError: error => console.log(error),
rejectionDelay: 10000,
});
client.consume({
channel: 'message',
process: async message => {
await sendAnEmail(message.description);
},
});
client.publish('message', { description: 'hello!' });