Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Mediation Data Agent is used to collect statistics related to mediation data from WSO2 products such as the WSO2 ESB, and send to the WSO2 CEP. CEP server receives data events via its Thrift API. This protocol uses a binary protocol and enables fast data transmission between ESB and CEP. You can configure the Mediation Data Agent can be configured early so that the statistics to be extracted from mediation data of CEP can be pre-definedearly in order to predefine the mediation statistics of CEP. In the configuration panel the user , you can specify the CEP server (Thrift server) related information and Properties the properties to be extracted from the Configuration Context of the ESB. The user should define Define the Event Stream-related parameters that are uniquely identified by a name and a version.

This page covers the following topics:

Table of Contents
maxLevel3
minLevel3

Installing the Mediation Data Agent

...

feature

The following installation instructions apply to WSO2 ESB version 4.5.x.
1.

  1. Download WSO2 ESB from url: http://wso2.com/products/enterprise-service-bus.

...

  1. When running both ESB and CEP servers concurrently, you should change the default port number of one server

...

  1. in order to prevent port conflicts. Apply a port offset in file <esb_home>/repository/conf/carbon.xml

...

  1. , by changing the value in xpath Server/Ports/Offset from 0 to some other integer. For example,

    Code Block
    languagehtml/xml
    <!-- Ports offset. This entry will set the value of the ports defined below to the define value + Offset. e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445 -->
     
    <Offset>2</Offset>

...

  1. Start the ESB server by executing the following files in <esb_home>/bin.
    • on Linux wso2server.sh
    • on MS Windows wso2server.bat

...

  1.  
  2. After starting the server, go to ESB management console. Instructions are similar to those in section

...

  1. Installing the Product.

...

  1. In the management console, select

...

  1. the Features sub menu under the Configure menu. Then, click the Repository Management tab, and select a P2 repository either from a URL or a file. For instructions, refer to section Managing the Feature Repository.

...

  1. For example,

...


  1. Image Added
  2. Go to

...

  1. Available Features

...

  1. tab and select the repository you added

...

  1. in the previous step. Then, click

...

  1. the Find Features

...

  1. button. From the list of features that appears, select

...

  1. BAM

...

  1. Mediation Data Agent Aggregate

...

  1. feature and click

...

  1. Install.

...



  1. Image Added

...

  1.  

...

  1. Click

...

  1. Next

...

  1. once done and accept the license agreement.  

...

  1. Restart the

...

  1. ESB

...

  1. .

...

Using the Mediation Data Agent

Here describes with Let's see, through a sample scenario, how to use the Mediation Data Agent to log mediation statistics data into a Cassandra Database. There are four basic steps involved.:

Configuring the Mediation Data Agent
Anchor
Configuring Mediation Data Agent
Configuring Mediation Data Agent

...

  1. Enable statistics in <ESB_Home>/repository/conf

...

  1. /carbon.xml

...

  1. as follows:

    Code Block
    languagehtml/xml
     <StatisticsReporterDisabled>false</StatisticsReporterDisabled>

...

  1. Log in to the ESB

...

  1. Management Console and select

...

  1. Mediation Data Publishing

...

  1. in

...

  1. Configure

...

  1. menu.

...

  1. Fill in the information in the Mediation Data Publisher Configuration

...

  1. window that opens.

...

  1. We have described the fields below with examples.

Image Added

Enable Mediation Stats: Select this option to enable the agent.

Enable Activity Service: This enables message tracing with CEP. Typically, a request is sent to an endpoint after being passed through some intermediate stages. Messaging tracing enables to track each messages and visualize the message body in each of these intermediate stages.

Info
titleNote

Enable Activity Service feature will be implemented from the next release

Stream Definition Configuration:

    • Stream Name : Stream Name can be any string with alpha-numeric characters
    • Version : Stream Version distinguishes different streams with the same Stream Name. Default version should be 1.0.0 .
    • Nick Name : This is a user preferred nick name to the Stream Name in alpha-numeric characters
    • Description : A description describing about the particular stream defined by Stream Name, Stream Version pair. Description should also consists of alpha-numeric characters.

BAM Credentials:

    • BAM URL : Enter the IP address of the CEP server. And the port should be the thrift port ( ex: tcp://127.0.0.1:7611 ). You can add a comma-separated list of server URLs to ensure that load is distributed among many servers and to minimize effects of a failure of one server node. This load balancing feature is a new enhancement.
    • Username: Put the CEP Thrift log-in user name. Default value is admin.
    • Password: Put the CEP Thrift log-in password. Default value is admin.

Properties: A CEP deployment can receive events from different data agents. In order to uniquely identify events triggering from one agent, a property can be associated it. This feature is particularly useful in clustered environment.

Click the "Update" button once done .

Setting the

...

backend server for ESB

...

endpoint
Anchor
Setting the Backend Server for ESB Endpoint
Setting the Backend Server for ESB Endpoint

In order to test the functionality of the Mediation Data Agent, user you can define a sample WSDL Proxy Service. Before creating that service, the user needs to create an Endpoint service as the WSDL Proxy Service . Steps to create an Endpoint service are as followsusing the following steps:
1.

  1. Navigate to <esb_home>/samples/axis2Server/src/SimpleStockQuoteService and build the backend service with Apache Ant. (Apache Ant should be installed. For instruction

...

  1. , refer to Installation Prerequisites).

...

  1. Go to <esb_home/samples/axis2Server and run the Axis2 server.
    • In Linux, axis2server.sh
    • In Windows, axis2server.bat

...

  1. Test whether the proxy service WSDL exists in http://localhost:9000/services/SimpleStockQuoteService?wsdl

Adding a proxy service to WSO2 ESB
Anchor
Add a Proxy Service to WSO2 ESB
Add a Proxy Service to WSO2 ESB

These Given below are the steps to create a sample WSDL Proxy Service to test the  Mediation Data Agent.1.

  1. Log in to ESB management console and select

...

  1. Add sub menu under the Proxy Service

...

  1. menu in the

...

  1. Main

...

  1. menu.

    Image Modified

...

  1. The

...

  1. Create Proxy Service from Template

...

  1. window opens. Click on

...

  1. WSDL Based Proxy

...

  1. link to create a new WSDL-based proxy.

    Image Modified

...

  1. The

...

  1. WSDL Based Proxy

...

  1. window opens

...

  1. , where you can fill information. For example,

...


  1. Image Added

    Fields marked with * are mandatory.


...

  1. Click

...

  1. Create

...

  1. button

...

  1. .

...

  1. The

...

  1. Deployed Services

...

  1. window opens. Select the newly-created proxy (Simple_Stock_Quote_Service_Proxy in this example) to access its service dashboard.

...


  1. Image Added

...

  1. Click the

...

  1. Enable Statistics

...

  1. link in category,

...

  1. Specific Configuration

...

  1. .

Image Modified

...

Sending messages to the ESB
Anchor
Send Messages to the ESB
Send Messages to the ESB

At this stage, Complete all the steps mentioned above should be completed in order to test above before testing the Mediation Data Agent. In this last step, the user you can send custom messages through the previously-created WSDL Proxy Service services created before, and test whether they are correctly stored in the Cassandra database. This is only an example, but the steps to use the Mediation Data Agent in a production environment are similar.1.

  1. Downloaded and start WSO2 CEP. Before starting the server, change its port offset to a different value in <CEP_home>

...

  1. /repository

...

  1. /conf

...

  1. /Carbon.xml file. This will prevent any port conflicts that can happen when starting more than one WSO2 products in a single server. For example,

    Code Block
    languagehtml/xml
    <!-- Ports offset. This entry will set the value of the ports defined below to the define value + Offset. e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445-->
    
    <Offset>2</Offset>

...

...

  1. Navigate to <ESB_home>/samples/axis2Client

...

  1. and build the backend service with Apache Ant (

...

  1. you need

...

  1. Apache Ant

...

  1. installed) with the following code.
Code Block
ant stockquote -Daddurl=https://localhost:8244/services/Simple_Stock_Quote_Service_Proxy -Dmode=fullquote -Dsymbol=testString

addurl value should be given from the https endpoint located in Simple_Stock_Quote_Service_Proxy's service dashboard. To access its dashboard, log in to ESB's management console and

...

select the List sub menu under Services in the Main menu. Then, click

...

the

...

Simple_Stock_Quote_Service_Proxy

...

service listed on the

...

Deployed Services

...

page. Any preferred string can be used instead of the testString for symbol )

...

hiddentrue

...