Develop Your First Event Integration¶
An event handle executes predefined actions in response to specific events. Devant simplifies the process of developing such integrations.
This guide walks you through the steps to develop an event integration using WSO2 Integrator:BI and Devant.
In this guide, you will build a simple event integration that monitors RabbitMQ for new messages and displays them once they become available.
Prerequisites¶
- GitHub account: Create a GitHub account if you don't have one already.
- If signing in to Devant for the first time, create an organization to begin with.
- VS Code: Install VS Code if you don't have it installed already.
- 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: Create the new integration¶
- Import a new repository to begin your integration. Refer Import a Repository for more details.
- Select the Technology as
WSO2 Integrator: BI. - Choose the Integration Type as
Event Integrationand click Create.
This redirects you to the Create New Integration in VS Code page.
Step 2: Install the WSO2 Integrator: BI extension and open the integration¶
- Install WSO2 Integrator: BI extension. Refer Install and Set Up WSO2 Integrator: BI for more details.
- Click Develop in WSO2 Integrator: BI. This will clone your integration project and open it in BI.
Step 3: Develop Event Integration in WSO2 Integrator: BI¶
-
From the left side panel, click + on the Configurations, 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 Handler. Choosing the Event Integration from the Devant console disables the other options.
- Provide the name of the RabbitMQ Configuration as
eventListener. - Select previously defined
hostandportconfiguration variables for the Host and Port. -
Then, expand the Advanced Configurations and enter the following configurables. Then click Next.
Field Value username usernamepassword password -
Add
Ordersas the Queue Name and click Create. If there is no queue namedOrdersin RabbitMQ server, this will create a new queue with this name. -
In the Design view, click the
onMessagefunction box. 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 4: Push to Devant¶
- Click the Source Control icon on the sidebar.
- Click + to stage all changes.
- Add an appropriate commit message and commit.
- Click Sync Changes to push the changes to remote.
- Go back to the Design view using the back arrow in the top left corner.
- From the right side panel, click the View in Devant to view this integration in Devant.
Step 5: Test the integration¶
-
Once you push the changes, the overview page of the Devant File Integration will automatically refresh and show you the Latest Commit and automatically build and show the Build Status.
Note
The build process may take some time. Once complete, the build status changes to Success. You can see the Build History by clicking Build in the left navigation.
-
Once the Build Status shows
Build completed, click onConfigure to Continueand details of RabbitMQ instance. -
Send a sales order message to the Orders on the RabbitMQ server. You can send a sample sales order message similar to the following:
{ "order_id": "12345", "customer_name": "John Doe", "product": "Widget", "quantity": 10, "total_amount": 100.00 } -
Observe the logs:
- You can view the order message in the logs pane of the development card.
-
After successfully testing, you can promote your event integration to production by clicking the Promote button.
Now you have gained hands-on experience in creating, configuring, deploying, and testing an event integration.


