Monday 13 August 2012

Extending value of WMB with Websphere Business Monitor and Websphere Business Events

Websphere Message Broker has lot of powerful capabilities in integration areas but how it fits inside large enterprise business solution.
This blog page intends to demonstrate the extension of Websphere Message Broker with Websphere Business Monitor and Websphere Business Events.
Having read almost all articles in the topic, I have put all them together to make big picture. You will find a lot of links in this thread, It is recommended that you read it uninterruptedly to the end for the first time, then you can re-read and go deeper into details.

What is Websphere Business Monitor?
Websphere Business Monitor is a Business Activity Monitoring product intends to capture events calculates  statistics and KPIs (Key Performance Indicator) and provides the capability of displaying theses statistics/KPIs in business dashboard to support business decision taking.
For more info about the product check presentations on infocenter here.
WBM is built on CEI (Common Event Infrastructure). CEI is a built-in framework to captures events from different sources and distributing them to different consumers. Standard format for event was defined namely CBE (Common Business Event).
For more information on CEI. Click Here.


Moving forward, How Message Broker can submit a CBE to CEI.

Message Broker is capable of generating two types of events.

  • Transaction Events (Transaction Start, Transaction End and Transaction Rollback)
  • Terminal Events (In, Out, End of data, Catch...)

There are three approaches of defining business events on a message flow. 
  • By using broker toolkit, as in the above screenshot.
  • By filling 'Monitoring Profile Name' property at BAR level.
  • By applying monitoring profile to message flow or all message flows in specific execution group. For more details please check.
At runtime broker publishes events on topic name $SYS/Broker/<brokerName>/Monitoring/<executionGroupName>/<flowName>. 
For more details on Defining broker monitoring events, Please check developerWorks link.

Starting from WMB version 7, Application Monitoring Information can be exported from broker toolkit then imported into Websphere Business Monitor workbench to facilitate generation of monitoring model.
Before WMB version 7, You will need to create monitoring model from scratch (definition of inbound event... etc).

Exporting Application Monitoring Information
1. In the toolkit's main menu, choose File->Export
2. In 'Export' window, choose 'Application Monitoring Information'

3. Pick message flow and output file name and directory

4. Extract the exported .zip file and check file WMBEvent.xsd.

You may observe that WMBEvent.xsd has not the same format as CBE object; IBM offers a message driven bean that can be deployed on Business Monitor WAS runtime that takes over the task of wrapping WMBEvent in CBE Payload then submits it to CEI.

IBM offers a MDB (Message Driven Bean) that should be deployed on Monitor's WAS. That MDB will listen to message broker event topic and received MBEvents then wraps them into CBE and submit it to the Monitor's CEI.

To enable connectivity between MQ queue manager and Monitor, JMS should be enabled on QM and TCP listener and server channel should be created. Then topic connection factory and topic JNDI records should be created in Monitor's WAS JNDI. So that the EventEmitter MDB can listen to that topic.

Connectivity Configuration Steps between WMB and WBM:
1. Create TCP/IP listener and start it.
2. Create Server-Connection channel and start it.
3- Run 'runmqsc brokerName < C:\Program Files\IBM\WebSphere MQ\java\bin\MQJMS_PSQ.mqsc'
4- On WBM WAS profile/Resources/JMS, Create JNDI topic connection factory and enter details of MQ connection (host-port-Listner-Server Channel.. etc)
5- Create JNDI topic and enter the topic connection factory and topic name.
6- From broker toolkit main menu's select Help->Samples and Tutorials->Monitoring->Websphere Business MonitorSample->Import the sample; EAR file should be in location '<Workspace>/WBMonitorEventsProject/WMBEventEmitterEAR.zip'
Also this
7- Extract WMBEventEmitterEAR.zip file then deploy WMBEventEmitter.ear on Business Monitor's WAS.
8- While installing the EAR, Add Bind Listener name 'AnyName'.
9- In the administration console add listener port with name 'AnyName' (Messaging -> Message Listener Service ->Listener Ports) and fill in JNDI Topic Connection Factory and JNDI Topic names created before.

End of configuration.
--------------------

What is Websphere Business Events?
WBE is event processing engine that collects business events and correlates them to detect  meaningful business patterns and accordingly emits action events.
WBE has eventually merged with Business Rules Management System in Websphere family; Websphere ILog; to be released in one product; Websphere Operational Decision Management. But the concept is still the same.
For more info about the product WikipediaAn Overview on IBM Education Assistant portal
IBM offers plug-ins nodes for Websphere Integration Developer and Websphere Message Broker to send WBE events and receive WBE actions.
Websphere Business Events product is built on WAS hence it's connectivity with Websphere Process Server and Websphere ESB is accomplished by adding WBE SIBX runtime jar to WPS/WESB runtime extension library then defining foreign SIB bus and SIB link on each runtime; The details are out of the scope.
WBE version7 comes with plugin nodes for Message Broker toolkit. Can be found in <WBE Installation Dir>/Integration/wmb.

Plug-in nodes:

  • WBEEventOutput
  • WBEActionInput

Before submitting WBE event, make sure that input message is transformed to WBE event schema using a mapping node (ESQL, Mapping .. ); The xsd of each WBE action and event should be exported from WBE workbench and imported into broker message-set.
These nodes uses broker java runtime to communicate with WBE. hence it is required to promote broker java runtime with IBM Client for JMS on J2SE, Download it from here.
Follow the instructions to extend broker java runtime with IBM Client for JMS on J2SE and WBE broker runtime here.
WBE plugin nodes have properties to refer to WBE JNDI binding and Event/Action Topic:
  • jms/actionTopic
  • jms/eventTopic 
Also these JNDI names are configurable.
The practice pattern of using WBE and WMB:
1- Define MBEvents (Transaction and Terminal) Events by any of there approaches mentioned above (Toolkit - Applying monitoring profile at BAR level - Applying monitoring profile using mqsichangeflowmonitoring command); MBEvents are published to topic(s):
$SYS/Broker/<brokerName>/Monitoring/<executionGroupName>/<flowName>. 
2- Create a stand alone message flow to capture MBEvents from topic subscriber (Usage of topic name wild card allows reception  of messages from many topics)

3- Wrap MBEvents with WBE event schema exported from WBE workbench.

4- Submit result WBE events using WBEEventOutput node.

Setup and example on developerWorks; here.

End of configuration.

Conclusion:
IBM chose to transfer events from Broker to Monitor by configuring Broker's QM as JMS Provider and uses a message driven bean to listen to specific topic on Broker's QM.
IBM chose to transfer events from Broker to Business Event by extending and configuring Broker's JVM as JMS thin client to submit events to WBE.

Connectivity Scenarios between WAS 7.0 and MQ. Click here
It is quite important to understand the basics.

Next Extending value of WMB with Websohere Operational Decision Management.

1 comment:

  1. Hi Mostafa,
    I have done these steps to connect WMB7 with WBM8. but instances arent getting created in Business Space.There is no error in either of the console and the message is going to out put queue and then getting consumed .Can you help me out with this

    ReplyDelete