Skip to content

amokrushin/rmqp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rmqp

NPM Stable Version Build Status Test Coverage Dependency Status Node.js Version License

Some sugar for amqp.node library

Features

Install

npm i rmqp

Usage

RabbitMQ Tutorials

Job queue

Publisher

const amqp = new AmqpClient(AMQP_URL);
amqp.assertQueue('job_queue');

const publisher = amqp.publisher(q, { contentType: 'application/json' });

publisher.write({taskId: 1, ...});
publisher.write({taskId: 2, ...});
publisher.end();

Worker

const amqp = new AmqpClient(AMQP_URL);
amqp.assertQueue('task_queue');

amqp.subscriber(q, { noAck: false, prefetch: 1 })
    .on('data', (message) => {
        ...
        message.ack();
    });

API

Documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published