Usage of BAM2 for Fault Detection in WSO2 ESB

ESB Monitoring with BAM

BAM can monitor the ESB using BAM mediators. ESB is made up with three channels that are responsible for input messages, output messages and fault messages. Each channel consists of sequences of mediators that process messages accordingly. BAM mediator is a special mediator that can be positioned between mediator sequences that can copy the messages passing through it and send them to the BAM for monitoring also you can use this BAM mediator to publish some custom information to BAM from ESB.

When fault messages are found they are identified by the BAM and take necessary actions to alert the required people. Sending an e-mail to a given e-mail address is one of such an option.

Fault Detection With BAM

All the messages intercepted by BAM from ESB are continuously stored in a Cassandra database. Periodically a set of analyzers called analyzer sequences are run on the stored message databases. Analyzer sequences can be designed directly with XML. An analyzer sequence can get messages from the message databases, detect fault messages and send e-mails the specified authorities.

WSO2 BAM Fault Detection in WSO2 ESB

Fault Detection Sample Guide

  1. Start BAM server with default settings. e.g.: maninda@my:~/wso2bam-2.0.0-ALPHA/bin$ ./wso2server.sh
  2. Log in to BAM console and go to Configure → Connection Parameters left menu item. WSO2 BAM Connection Parameters
  3. Submit following default connection parameters for Connection Parameters and submit. Username : admin Password : admin WSO2 BAM Login Connection Parameters Submit
  4. Run the ant script in ${BAM_HOME}/samples/fault-detection-and-alerting directory, by typing ant in the console. This will simulate another server (ex: WSO2 ESB) pumping in events. Ant Fault Detection Pump
  5. Go to Configure → BAM Database left menu item and click "Add Index" and provide the values shown below to create an index for activity data on BASE table. Adding Activity Index
  6. Go to Configure → Analyzer Framework left menu item. Click on "Add Sequence" to add a new analyzer sequence. Adding Analyzer Sequence
  7. Copy FaultDetector.xml content and paste it in the "source" tab of analyzer design view. In the Alert analyzer, enter an email address you would like to receive the alert to. You will notice that you can configure the alert analyzer to send mails from a preferred email address given that you have teh credentials and the smtp host. Adding Fault Detection Analyzer Sequence
  8. Save the analyzer. Saving Fault Detection Analyzer Sequence
  9. After the analyzer task has run an alert email should appear in the provided email account with fault details. Fault Detection E-mail