RabbitMQ Integration
This tutorial explains how you can establish connection with RabbitMQ message broker using Events Correlator context.
Configuring Extension Folder
First of all you'll need to designate the Extensions Folder field for the Event Correlators plugin. All downloaded correlator extensions should be put in this folder.
The Event Correlators properties window can be found by selecting Edit Driver/Plugin Properties from the context menu of the Event Correlators node in the system tree.


Downloading RabbitMQ Extension
Download the RabbitMQ plugin using the following link: https://github.com/siddhi-io/siddhi-io-rabbitmq. Put the plugin to the folder set in the previous step.
Downloading Map Extension
To correctly parse and process an incoming data stream, a correlator must have the corresponding mapping plugin. You can find a list of available plugins using the following link: https://siddhi-io.github.io/siddhi/extensions/.
In this tutorial we're going to work with plain text messages so you'll need to download the corresponding extension using the following link: https://wso2-extensions.github.io/siddhi-map-text/.
Put the plugin to the folder set in the first step. You'll need to restart the server at this point.
After server restart RabbitMQ entities (source and sink) as well as text mapper will become available in Event Correlator's scripts.
Configuring Event Correlator
Now we're ready to create and configure an event correlator.
Choose Create from the Event Correlators node in the system tree to open the Properties window of a new correlator:

Put the following script in the Correlator Script field:
@sink (type = 'internalEvent',
event = 'test',
@map(type = 'internalEvent'))
define stream FooStream (text string);
@source(type ='rabbitmq',
uri = 'amqp://guest:guest@localhost:5672',
exchange.name = 'logs',
@map(type='text'))
define stream BarStream (text string);
from BarStream select text insert into FooStream;
This script describes how messages sent to 'logs' exchange of the local RabbitMQ broker (BarStream
) are being intercepted and converted into a set of Iotellect Server events (FooStream
). Incoming messages are expected to be in textual format (@map(type='text')
). The expected input is as follows: text:'Message'
. Once a message is received its data will be extracted and put to text
field of the corresponding Iotellect Server event.

For this script to work, you'll also need to define an Output Event Format for a test
event of the Event Correlator context.
Was this page helpful?