0.0.7 • Published 5 years ago

rabbitmq-helper v0.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

rabbitmq-helper

An easy to use module for rabbitmq worker queues. Create consumer and producers for rabbitmq worker queue

Installation

npm install rabbitmq-helper@latest

Usage

Producer

const RabbitMqProducer = require('..').RabbitMqProducer;

var options = {
    ip: '172.17.0.2',
    queue: 'qwerty'
};

var producer = new RabbitMqProducer(options);

let id = 0;
function send(){
    console.log(producer.send({data:'qwerty',id:id++,time:new Date()}));
    setTimeout(send,100);
}
setTimeout(send,1000);

Consumer

const RabbitMqConsumer = require('..').RabbitMqConsumer;

var options = {
    ip: '172.17.0.2',
    queue: 'qwerty'
};

var consumer = new RabbitMqConsumer(options);

consumer.on('data',console.log);

consumer.start();

//consumer.stop();

Tests

:( not yet

Contributing

This was a very quick hack. PRs are welcome!

0.0.7

5 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago