Skip to content

dirigiblelabs/ext-rabbitmq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

RabbitMQ API

Overview

API endpoints for working with RabbitMQ messaging broker in Eclipse Dirigible

Getting Started

You will need RabbitMQ installed on your machine. You can find all relevant information in the official documentation below:

API Endpoints

RabbitMQ Consumer

The RabbitMQ Consumer is listening on a queue destination to a RabbitMQ server.

Basic Usage

Start listening on a queue

var consumer = require("rabbitmq/consumer");
consumer.startListening("rabbitmq-queue", "<rabbitmq-project>/<rabbitmq-handler>");

File: <rabbitmq-project>/<rabbitmq-handler>

exports.onMessage = function(message) {
    console.log("Hello from My RabbitMQ Listener! Message: " + message);
};

exports.onError = function(error) {
    console.error("Error from My RabbitMQ Listener! Error: " + error);
};

Stop listening on a queue

var consumer = require("rabbitmq/consumer");
consumer.stopListening("rabbitmq-queue", "<rabbitmq-project>/<rabbitmq-handler>");

RabbitMQ Producer

The RabbitMQ Producer is sending message to a queue to a RabbitMQ server

Basic Usage

Send message to a give queue (implicitly creates connection, channel and the named queue if missing)

var producer = require("rabbitmq/producer");
consumer.sendMessage("rabbitmq-queue", "My RabbitMQ message");

Releases

No releases published

Packages

No packages published