WSO2 Enterprise Integrator 3 min

Integrating ESB 4.9.0 and DAS 3.0.1 to use Events synchronization

Andrey Cunha
Andrey Cunha
Senior Integration Consultant
wso esb 1

wso2-data-analytics-server.svg So your WSO2 ESB is running smoothly in your SOA architecture and all sorts of data are flowing from one application to another? Great! Knowing exactly what is happening ‘under the hood’ can help you make business decisions on a daily basis. That is where WSO2s Data Analytics Server comes in: by gathering and analyzing useful information on performance, usage and events, DAS will provide you with useful insights through its user-friendly dashboards.
In this blog we will show you how to capture data from WSO2 ESB events and get information on analytics from your service bus. In order to illustrate our story, we will use the VFS transport protocol, so make sure you have it enabled in your WSO2 ESB Server.

This example will explain:

  1. How to set up WSO2 ESB to send information to the Data Analytics Server
  2. How to tell WSO2 DAS which data it can expect and where to store it
  3. How to make WSO2 DAS analyze your data
  4. How to Publish the analyzed data

Before we start, do not forget to change the port offset in one of the products if they are running on the same server. All set? Let us get into some details:

  1. ESB: Enabling VFS transport:

Let’s change the transport Sender and Receiver in ESB_HOME/repository/conf/axis2/axis2.xml:

<transportReceiver name=”vfs” class=”org.apache.synapse.transport.vfs.VFSTransportListener”/>

<transportSender name=”vfs” class=”org.apache.synapse.transport.vfs.VFSTransportSender”/>

  1. ESB: Setting up BAM Server Profile:

Configure the BAM Server Profile and setup to your DAS Server as showing below:


In stream configuration field, let us set the fields for our message and environment variables:


In this scenario, we will just get the fields origin and destination from the XML message file and the context variable which identifies the flow (business.flow).

  1. ESB: Writing the proxy service

For this example, we will use this custom proxy:

Looking to the proxy sourcecode, we have the exactly reference for the BAM Profile we have created in step 2. In this example, everytime the proxy get a xml file in the transport.vfs.FileURI, it will send data to DAS in inSequence and faultSequence.

  1. DAS: Creating the stream

In the DAS, we don’t need to create the stream manually as ESB will create automatically in the first request to the proxy. Below we can see what happens when I send the first request from DAS:


Checking in DAS Event Streams, we can see the event created:


  1. DAS: Getting the information to the database

To record the information in the stream, we have to edit the stream and check what fields we’d like to have in the table.


Now we should have the table created.

  1. DAS: Creating a Receiver (Almost there)

If we use the proxy now, it will not work instantly, as we can see below:


To get the data from the event stream, it is required to create an event receiver:


Going to Main/Event Receivers, let’s choose the input event adapter type as wso2event and we need to select the event stream we want to receive the messages for, in our case ESBstreamDAS:1.0.0.

Looking to the log, we will get the following:


  1. DAS: Finally the data

Sending the request from the proxy again, we can see the records in the table:


I can hear you think: kay, so I have just created a table, so what?

  1. DAS: Getting the graphics

So let us have some fun with this data: using DAS’s dashboard server we can create appealing report dashboards including “gadgets”.

Select the stream:


Chart type:


And the axis:

And there it goes:


If we look back on the event flow, we can see the map of different streams connector:


In this simple example you learned how to use the BAM Mediator from WSO2 ESB to send event information to WSO2 Data Analytics Server. There is a lot to explore in event publishing and even more in how to analyze your information. Are you interested in how Data Analytics can help you make decisions based on facts? Feel free to contact us!

Read also our other WSO2 tutorials and blogs, written by our WSO2 GurusIn case you need WSO2 support, contact the Yenlo WSO2 Guru team to get WSO2 Development Support or WSO2 Operational Support. Of course we do deliver excellent WSO2 training services as well, based on reallife WSO2 tutorials.

Thanks to Domenique Mulder for his contribution to this blog.

Full API lifecycle Management Selection Guide

whitepaper hero
Get it now
We appreciate it
Care to share

Please select one of the social media platforms below to share this pages content with the world