1.1.1 • Published 10 years ago

rabbitrpc v1.1.1

Weekly downloads
5
License
GPL-2.0
Repository
github
Last release
10 years ago

node-rabbitrpc

Some modules to require to create producers / consumers using AMQP-RPC

features

  • Auto reconnect
  • Built on top of amqplib
  • Full promise support

how to use it

consumer

listen on a queue and send back a message

//you can also just require('amqprpc')(); if your broker is local
var amqprpc = require('rabbitrpc')( { AMQP_URL: 'amqp://localhost' });
amqprpc.consumer
.connect() //this create your channels and setup the amqp connexion
.then(function(){
  amqprpc.consumer.createQueue('queue:name', function(msg){
    //handle your msg, you can create a promise, or return a value. Result will be sent to producer
  });
});

producer

send a message to a queue and listen for a response

//you can also just require('amqprpc')(); if your broker is local
var amqprpc = require('rabbitrpc')( { AMQP_URL: 'amqp://localhost' });
amqprpc.producer
.send('queue:name', { message: 'ok', data: {/* whatever */} })
.then(function(response){
  //handle your response here!
  //see consumer example to check how to respond to a producer
});
1.1.1

10 years ago

1.1.0

10 years ago

1.0.15

10 years ago

1.0.14

10 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago