New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

egg-mq

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-mq

egg rabbitmq plugin

0.1.0
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

egg-mq

Install

$ npm i egg-mq --save

Usage

// {app_root}/config/plugin.js
exports.mq = {
  enable: true,
  package: 'egg-mq',
};

Configuration

// {app_root}/config/config.default.js
const mq = require('./mq.json');

exports.mq = {
  rabbitmq: { address, port, username, password },
  ...mq
};
// {app_root}/config/mq.json
{
  "producers": [
    {
      "exchange": "eggmqproducer.exchange.message",
      "exchangeType": "topic"
    }
  ],
  "consumers": [
    {
      "exchange": "eggmqproducer.exchange.message",
      "exchangeType": "topic",
      "queue": "eggmqconsumer.queue.textMessage",
      "topic": "text.*",
      "consumer": "foo.bar"
    }
  ]
}

Example

// producer
ctx.service.mq.producer('some.exchange', 'some.topic', payload);
// ctx.service.consumer
async consumer(topic, payload) {
  ctx.logger.info(payload);
}

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

egg

FAQs

Package last updated on 17 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts