1.0.6 • Published 6 years ago

dw-rabbitmq v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Module created to handle communication with a RabbitMQ server.

Example:

//To get the service up and running
const {RabbitMQService} = require('dw-rabbitmq');
const rabbitmq = new RabbitMQService('amqp://localhost');
await rabbitmq.start();

//publishes a message to an exchange/routing key
await rabbitmq.publish('Content message', 'exchange', 'routing-key');

//callback signature for a consumer function 
function consumerCallback(payload, ack){
  //Does some stuffs with the payload
  ...
  ack(true); //acknowledge the message on RabbitMQ Server
}

//set a consumer callback on a specific exchange/routing key
await rabbitmq.consume('exchange', 'routing-key', consumerCallback);
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago