fb
WSO2 Enterprise Integrator 4 minutes

WSO2TORIAL: Getting started with ESB 5.0.0 Analytics

Rob Blaauboer
Rob Blaauboer
Integration Consultant & WSO2 Trainer
ESB 5.0 analytics notepad
Scroll

In order to use the WSO2 ESB 5.0.0 we need to set up the three elements:

  • ESB
  • ESB – Analytics
  • ESB – Tooling

You can download these from the WSO2 website or use the new WSO2 Update Manager.

Port offsets

It is important to have WSO2 products that run on the same server to have a different port offset.

In this case we will put the port offset as follows:

Product Port Offset
WSO2 ESB 0
WSO2 ESB Analytics 10

The ESB-Tooling is actually Eclipse with specific ESB and Governance Registry Developer Studio features and therefor does not need a port offset.

The portOffset is done in the [ESB-HOME-ANALYTICS]/repository/conf/carbon.xml file. You can edit this file with your favourite editor (e.g. notepad, notepad++, gedit or vi).

ESB_5.0_analytics_notepad.png

Warning

In order to start the ESB Analytics on Windows , another library is needed (snappy-java-1.1.1.7.jar). Please place this jar file in [ESB-ANALYTICS-HOME]/repository/components/lib.

Configuring the ESB Analytics

In order to enable statistics and message tracing it is necessary to enable the mediation statistics and message tracing as required by configuring the ESB 5.0.0

[ESB-HOME]/repository/conf/synapse.properties file.

This entails setting the following variables:

Property Required Value Purpose
mediation.flow.statistics.enable True Setting this property to true
results in the following information being recorded.

·       The time  spent on each
mediator.

·       The time spent to process
each message.

·       The fault count of a single
message flow.

mediation.flow.statistics.tracer.
collect.payloads
True Setting this property to true results
in the message payload before and
after the mediation performed by
individual mediators being recorded.
mediation.flow.statistics.tracer.
collect.properties
True Setting this property to true results
in the following information being
recorded.

·       Message context properties.

·       Message transport-scope
properties.

mediation.flow.statistics.collect.
all
True/False

If this property is set to true,
mediation statistics is enabled for
all the artifacts in your WSO2 ESB
server by default.

You can enable statistics for the ESB artifacts by setting this property only if the mediation.flow.statistics.enable
property is also set to true.

If this property is set to false, statistics and/or tracing needs to be manually enabled for the required artifacts.

These four variables are found near each other in the file:

Variables-getting_started_with_esb_5.0.png

Step 2 Setting the message flow configuration

This step involves providing the information required by WSO2 ESB to publish data to the Analytics – ESB server in order to analyze the data using the Analytics Dashboard. An event publisher (a process that sends data over to the ESB Analytics) is configured with the URL to which WSO2 ESB related information are published as events.

We need to change the correct Event Publisher configuration:  [ESB-HOME]/repository/deployment/server/eventpublishers/MessageFlowConfigurationPublisher.xml 

The values below need to be entered in this file. Please note that password is not by default present, it should be added as a XML tag pair.

 and enter relevant configurations as described in the table below. This file is used to enter the information required to publish WSO2 ESB data to the ESB Analytics server. These values are filled in already (APART FROM THE receiverURL thrift port) but nevertheless check them before starting. The password value will be encrypted after the first start of the ESB, resulting in something like the following:

<property encrypted="true" name="password">kuv2MubUUveMyv6GeHrXr9il59ajJIqUI4eoYHcgGKf/BBFOWn96NTjJQI+wYbWjKW6r79S7L7ZzgYeWx7DlGbff5X3pBN2Gh9yV0BHP1E93QtFqR7uTWi141Tr7V7ZwScwNqJbiNoV+vyLbsqKJE7T3nP8Ih9Y6omygbcLcHzg=</property>

This means that the password cannot be changed from the xml file. This is the similar process as with the user-mgt.xml file where the admin password is also store in plaintext

Property Required Value Example
username The username to be used when accessing the Analytics server to publish configurations. admin
password The password to be used when accessing the Analytics server to publish configurations. admin
receiverURL The URL of the thrift port to which the ESB configurations should be published. The format of the URL is as follows.
tcp://<localhost>:<THRIFT_PORT>
tcp://localhost:7621

Open the [ESB-HOME]/repository/deployment/server/eventpublishers/MessageFlowStatisticsPublisher.xml file, and do the configurations and specified in the table below.

Property Required Value Example
username The username to be used when accessing the Analytics server to publish statistics. admin
password The password to be used when accessing the Analytics server to publish statistics. admin
receiverURL The URL of the thrift port to which the ESB statistics should be published. The format of the URL is as follows.
tcp://<localhost>:<THRIFT_PORT>
tcp://localhost:7621

Starting the ESB

Start the Analytics server first before starting the ESB. This because the ESB wants to connect to the thrift port of the Analytics server. If both products start without problems, you can access the Analytics dashboard. Please enable popups of no dashboard is started if you click on this:

Analytics_dashboard_ESB_5.0.png

WSO2_dashboaed_designer_login-1.png

When accessing the dashboard, you need to login with the default (admin/admin) credentials.

However, at this time it is still empty since no invocations have been made. In order to see invocations, you need to wait until you have created some APIs, Proxies or Endpoints. If you would have any invocations, you would see a screen like this:

Invocations_ESB_Analytics.png

Now you are ready to start with ESB 5.0 Analytics!

Read also our other WSO2 tutorials and blogs, written by our WSO2 Gurus. In 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.