1.1.19 • Published 2 years ago
@amaui/amqp v1.1.19
Getting started
Add
yarn add @amaui/amqpAdd amqplib peer dependency.
yarn add amqplibUse
import AmauiAmqp from '@amaui/amqp';
// Make if you wanna a config file and
// inside of it add all the process.env related props
import Config from './config';
// Make a new amqp instance
const amauiAmqp = new AmauiAmqp({
uri: Config.amqp.rabbitmq.uri,
queues: Config.amqp.rabbitmq.queues,
exchanges: Config.amqp.rabbitmq.exchanges,
});
// Await for a channel
await amauiAmqp.channel;
// Send to a queue
await amauiAmqp.send('a', 'a');
// Check a queue
await amauiAmqp.checkQueue();
// { queue: 'a', messageCount: 1, etc. }Dev
Install
yarnTest
yarn testOne time local setup
Install docker and docker-compose
Make docker containers
yarn dockerProd
Build
yarn build