egg-amqp
Amqp client for egg framework with amqplib.
Install
$ npm i egg-amqp --save
Usage
// {app_root}/config/plugin.jsexportsamqp = enable: true package: 'egg-amqp';
Configuration
// {app_root}/config/config.default.jsexportsamqp = protocol: 'amqp' hostname: 'localhost' port: 5672 username: 'guest' password: 'guest' vhost: '/' // opts: {},;
see config/config.default.js for more detail.
Example
Produce
const ch = appamqp; ch;ch;
Consume
const ch = appamqp; ch;const msg = ch;ch; console; // hello world
Questions & Suggestions
Please open an issue here.