amqplib-rpc-client
Rpc client based on amqplib.
Installation
This module is installed via npm:
$ npm install amqplib-rpc-client
Example Usage
var amqplibRpcClient =expect = ;;
Usage/conventions
Uses the replyTo
field to transmit the expected routingKey a response should be publish on by the server.
Expects message to be valid JSON.
Will emit()
events based on the type
field of the message content. The entire JSON object is given as arg 2. e.g:
emit('data', { type: 'data', result: 'moo' });
Running tests
npm test
To run the tests RabbitMQ is required. Either install it with your package manager, or use docker to run a RabbitMQ instance.
docker run -d --name amqp.test -p 5672:5672 rabbitmq