Develop Event Integration¶
Overview¶
In this guide, you will build a simple event integration that monitors RabbitMQ for new messages and displays them once they become available.
Prerequisites¶
Before you begin, make sure you have the following:
- Visual Studio Code: Install Visual Studio Code if you don't have it already.
- WSO2 Integrator: BI Extension: Install the WSO2 Integrator: BI extension. Refer to Install WSO2 Integrator: BI for detailed instructions.
- Set up RabbitMQ:
- Use an existing RabbitMQ instance or start a new RabbitMQ instance on a server that can be accessed via the internet.
- Obtain the
host,port,username, andpasswordfrom the RabbitMQ instance.
Step 1: Develop Event Integration in WSO2 Integrator: BI¶
- In WSO2 Integrator: BI design view, click Add Artifact.
- Select Event Integration from the Constructs menu.
- Click Create to create an event integration. This directs you to the event integration diagram view.
-
Go to the Design View by clicking the Home icon in the top left corner, click on the Configure button, and add the following configurables.
Configurable Type hoststringportintusernamestringpasswordstring -
Go to the Design View by clicking the Home icon on the top left corner and click Add Artifact.
- Select RabbitMQ Event Integration. Choosing the Event Integration from the Devant console disables the other options.
- Add
Ordersas the Queue Name and click Create. If there is no queue namedOrdersin the RabbitMQ server, this will create a new queue with this name. - Select previously defined
hostandportconfiguration variables for the Host and Port and click Save.
- In the Design view, click the Configure button, which will take you to the Configuration page for the Event Integration.
- Scroll down and find the fields
UsernameandPasswordand set the corresponding configurables. - Click Save Changes and go back to the Design view.

- Click the
+ Add Handlerbutton and selectonMessage, which will open up the handler configuration form. - Click Save, and it will redirect you to the flow diagram view.

- Click the plus icon after the Start node to open the node panel.
-
Add a Log Info node with the Msg as
message.toString().
Step 2: Run the integration in WSO2 Integrator: BI¶
- Click Run in the top-right corner to run the integration. This compiles the integration and runs it in the embedded Ballerina runtime.

