Versions Compared

Key

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

BAM Mediation Data Agent is used to collect statistics related to mediation data from WSO2 ESB and send to WSO2 BAM. The BAM server receives data events via its Thrift API. This is a binary protocol that enables fast data transmission between the ESB and BAM. It is possible to configure BAM Mediation Data Agent early so that you can predefine the statistics to be extracted from mediation data of ESB. In the configuration panel, specify the BAM server (Thrift server) related information and properties to be extracted from the Configuration Context of ESB. Also specify the Event Stream related parameters uniquely identified by a name and a version.

...

  1. Download WSO2 ESB version 4.5.x or later from http://wso2.com/products/enterprise-service-bus. Since BAM Mediation Data Agent Aggregate feature is available by default from ESB 4.6.0 onwards, you do not have to install it separately if you use a newer ESB version.
  2. When running both ESB and BAM servers concurrently, you must change the port of one server in order to prevent port conflicts. This is done by applying an offset in file <ESB_HOME>/repository/conf/carbon.xml. Change 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>
  3. Start the ESB server by executing the following commands from <ESB_HOME>/bin.
    • on Linux wso2server.sh
    • on MS Windows wso2server.bat
     
  4. After starting the server, log in to ESB's management console (https://localhost:9443+offset/carbon)
  5. In the management console, go to Configure > Features menu.
  6. In the Repository Management tab, select and add a P2 repository either from a URL or a file. For instructions, see Managing the Feature Repository.

    Info

    WSO2 features are available in Equinox P2 repository at http://dist.wso2.org/p2/carbon/releases. Repositories are listed there by WSO2 Carbon platform versions.

  7. After adding the repository, go to Available Features tab. From the repository drop-down list, select the one you added above. The, click Find Features.
  8. From the list of features that appears, select BAM Mediation Data Agent Aggregate feature and Install.
  9. After the installation is done, restart the ESB server.

...

  1. Enable statistics in <ESB_HOME>/repository/conf/carbon.xml file as follows:

    <StatisticsReporterDisabled>false</StatisticsReporterDisabled>
  2. Log in to the ESB management console and select Mediation Data Publishing in the Configure menu.
  3. The Mediation Data Publisher Configuration window opens. Fill in the field. By default the Stream name must be bam_mediation_stats_data_publisher. For example,
    The fields of the above page are described below:

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

    Stream Definition Configuration:

    • Stream Name : Any string value with alpha-numeric characters.
    • Version : Stream version distinguishes different streams with the same stream name. Default version is 1.0.0.
    • Nick Name : This is a user-preferred nick name to the stream name in alpha-numeric characters. Useful when stream name is lengthy and you want to keep a shorter alias for convenience.
    • Description : A description about the stream identified by Stream Name, Stream Version pair. Description should also consist of alpha-numeric characters.

    BAM Credentials:

    • BAM URL : IP address of the BAM server. Port must be the thrift port (e.g., tcp://127.0.0.1:7611). Add a comma-separated list of server URLs here to ensure that the load is distributed among many servers. It minimizes effects of a failure of one node.
    • Username and Password: BAM Thrift login user name and password. Default values are admin/admin.

    Properties: BAM receives events from different data agents. You can associate a property to uniquely identify the events triggering from one agent. This feature is particularly useful in a clustered environment.

...

  1. Navigate to <ESB_HOME>/samples/axis2Client and build the backend service with Apache Ant as follows:

    ant stockquote -Daddurl=https://localhost:8244/services/Simple_Stock_Quote_Service_Proxy -Dmode=fullquote -Dsymbol=testString

    Daddurl value must be given from the HTTPS endpoint located in Simple_Stock_Quote_Service_Proxy service's dashboard. To access its dashboard, log in to ESB's management console and click Services > List menu in the Main menu. Then, click the Simple_Stock_Quote_Service_Proxy service from the Deployed Services page. Instead of the testString for symbol, you can use any preferred string.
  2. Once done, the BAM Mediation Data Agent in the Simple_Stock_Quote_Service_Proxy service sends statistics from the ESB to the column family with the given stream name in key-space EVENT_KS in the Cassandra database. Use Cassandra Explorer in BAM to see the data in the Cassandra database. For example,

Descriptions of the above payload data values, which will be automatically generated through the ESB are as follows.

Event Property NameDescription
StreamIdID of the stream.
TimestampTimestamp of the event at the time it is getting published.
payload_avg_processing_timeAverage time to process the payload by ESB.
payload_countNumber of messages received by ESB.
payload_directionWhether the payload is an incoming/outgoing message from/to ESB. Applicable values are either in or out.
payload_fault_countIf the message has been encountered any fault when serving the request, then this will be incremented as 1. If request successfully served, this count will be 0.
payload_max_processing_timeMaximum time to process the payload by ESB.
payload_min_processing_timeMinimum time to process the payload by ESB.
payload_resource_idThe ID of the ESB resource type.
payload_stats_typeStates the ESB resource type, from which the payload was published from. Applicable values are "Proxy", "Sequence", "Endpoint" and "Any".
payload_timestampThe time of when the request came into WSO2 service hosting server (WSO2 AS), not the time which the event was received by BAM server.

Analyzing the mediation statistics
Anchor
what does mediation stats tells
what does mediation stats tells

...