1.0.6 • Published 5 years ago

dw-rabbitmq v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
5 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

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago