info@yenlo.com
eng
Menu
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

wso-esb.png
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:

Configure_the_BAM_Server_Profile_and_setup_to_your_DAS_Server.png

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

Stream_Configuration.png

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:
ESB_writing_custom_proxy.png

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:

DAS-creating_the_stream.png

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

WSO2_DAS_Event_stream.png

  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.

Edit_WSO2_DAS_Stream.png

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:

WSO2_DAS_Data_Explorer.png

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

WSO2_DAS_Create_a_New_Event_Receiver.png

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:

WSO2_DAS_-_ESB_Log.png

  1. DAS: Finally the data

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

WSO2_DAS_Data_explorer_2.png

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:

WSO2_Dashboard_designer-1.png

Chart type:

WSO2_Dashboard_Designer_-_chart_type.png

And the axis:
WSO2_Dashboard_Designer_-_axis.png

And there it goes:

Getting_the_chart_-_WSO2_DAS-ESB_blog.png

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

CEP_event_flow.png

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.

eng
Close