The RabbitListener SIB Listener consumes RabbitMQ queues. When a message is received the listener transforms the message to a SIB message and triggers the workflow.
Module | sib_rabbitlistener |
Version | 1.3.4 |
var RabbitServiceCustom = { _id: "rabbitSample:1", _name: "SIB RabbitMQ Listener Sample", loggerCfg: { dest: { file: false, console: true, mqtt: true } }, init: ( thisListener )=>{}, inputFormat: (topic, msg, cb)=>{ cb(msg); }, rabbitmq: "amqp://localhost", ack_timeout: 60000, prefetch: 0, q: [{path: "path/to/queue", bo: "path/to/queue/bo", archive: "path/to/queue/archive", durable: true, noAck: false}], mqtt: "mqtt://localhost", topic: "SIB/Samples/RabbitListener" }; module.exports = RabbitServiceCustom;
To perform a basic.ack publish a message of the following format to the response MQTT topic:
{"ack": msg._sibheader.msgId}
To transfer a message to the backout queue, return the entire outgoing message with an added value of “error: true”. The message will be put in the backout queue and the original message will be acked if applicable.