Module: rmq-wrapper

Utility functions for connecting, producing and consuming messages on RMQ

Source:

Members

(inner, constant) consume

This method connects to a queue and calls the provided callback consumeFunction when a message is received on the queue

Source:

Methods

(inner) cancel(queue) → {Promise}

This tells RMQ to stop announcing new messages, so the callback consumeFunction is no longer called. The queue should be re-connected to restart message delivery.

Parameters:
Name Type Description
queue string

name of the queue to listen on

Source:
Throws:
exception
Returns:

Resolved when the queue was cancelled

Type
Promise

(async, inner) produce(queue, message, persistentopt) → {Promise}

This produces a message on RMQ, assumes that the connect() method was previously called

Parameters:
Name Type Attributes Default Description
queue string

name of the queue to listen on

message string

stringified text to be put on the queue

persistent boolean <optional>
"true"

if true the message is stored peristently on the queue

Source:
Throws:
exception
Returns:

Resolved when the message was produced on the queue

Type
Promise