Running the WebSphere Business Monitor sample

Before you can run the sample you must have imported and deployed the WebSphere Business Monitor sample, and completed the instructions in Setting up the WebSphere Business Monitor sample.

The following steps show you how to create a monitor model application from the model, and a dashboard based on the model.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the IBM Integration Bus documentation.

Generate the monitoring model application

These instructions are written for WebSphere Business Monitor V8.0.1 and use the WBMonitorEventsModel model, which has been created by using the export monitoring information option in the workbench.

  1. From the IBM Integration Toolkit, open the WBMonitorEventsProject project and export the MonitorModels.zip project interchange file by clicking Export > General > File System.
  2. Open the Business Monitoring perspective in the IBM Integration Designer.
  3. Import the MonitorModels.zip project interchange file into the MME by clicking Import > Other > Project Interchange.
  4. Open WBMonitorEvents_Project, and select WBMonitorEventsModel.mm.
  5. Right-click the monitor model and, from the menu, select Generate Monitor Java EE Projects.
  6. In the Generate Monitor Java EE Projects wizard you can either keep the default project name that is automatically generated or supply your own project name.
  7. Write down the name for the J2EE Application Project Name and click Finish.
  8. When the code generation is complete, switch to the Java perspective.
  9. Right-click the enterprise archive (EAR) application project that is generated. If you used the default J2EE Application Project Name, the name is WBMonitorEventsModelApplication.
  10. Right-click the generated EAR application project and select Export > EAR File. In the Export wizard, click Browse to select the file directory and the EAR file name to which the EAR application must be exported.

Installing and configuring the monitoring model application

  1. Start your Monitor Server.
  2. Open the Monitor Server administrative console and, from the navigation panel, click Applications > New Application and select New Enterprise Application.
  3. Set Path to the new application to the location of the exported EAR application, and click Next on the remaining panels.
  4. Review the summary information and click Finish. Check for the message that states that the application has installed successfully.
  5. Click Save to save the changes to the master configuration.
  6. Click Applications > Application Types > WebSphere Enterprise Applications and select WBMonitorEventsModelApplication, click Start. The Application Status now contains a green arrow.

Create a WebSphere Business Monitor dashboard

These instructions describe creating a dashboard for WebSphere Business Monitor 7.0.

Note: If security is enabled in your Monitor Server, you might have to use the Monitor Data Security panel in the Monitor Server administrative console to assign appropriate permission so that your monitor models are visible in the dashboard. For more information, see This link opens in a new window IBM WebSphere Business Process Management Information Center.

  1. Start the Business Monitor dashboard.
  2. In the Business Space Manager, on the banner click Actions and select Create Space.
  3. Type in a name for the new space in the Space Name field. Click Save.
  4. Create a page by selecting the Create a Page (+) icon in the banner.
  5. Enter the name of the page in the Title field. Click Save.
  6. Click the created page. Click Edit Page.
  7. In the Widget panel, select Instances and click the Add to page (+) icon.
  8. In the Instances panel, select Edit Settings from the menu.
  9. Select the Show/Hide page.
  10. If you see the following message If no monitor models are displayed, either no models are installed or you are not authorized to view the installed models, go to the Monitor Server administrative console and complete the following steps:
    1. Select Security > Monitor Data Security and click Root.
    2. Highlight the models in the Models pane. Select KPI-Administrator and click Edit on the Users pane.
    3. Click Search. In the Available column, select the user that you want to use. To move the user to the Selected column, click the arrow (>) and click OK.
    4. On the Monitor Data Security Administration page, click OK.
    5. Go back to the Business Space Manager and refresh the page, the installed monitor models are displayed.
  11. Select WBMonitorEventsModel in the "Select the monitoring contexts to personalize" pane. Drill down and select TotalPurchaseOrderFlow. Select all the columns under Available, click the double arrow (>>) to move them to the Selected column.
  12. Click Set as default.
  13. Click OK.
  14. Now add some KPIs:
    1. In the Widget panel, select KPIs and click the Add to page (+) icon.
    2. From the KPIs panel select Edit Settings from the menu.
    3. Click the plus sign (+) beside WBMonitorEventsModel to expand the list of KPIs.
    4. Select some of the KPIs from the list. For example, Total Gold Customer Orders, Total Regular Customer Orders, and TotalPurchaseOrderFlow Average Transaction Duration.
    5. Click OK.

Install and configure the message-driven bean (MDB)

In this sample, WebSphere MQ is configured as the JMS Provider. You must set the following definitions on the Websphere MQ queue manager before you can configure WebSphere MQ as the JMS Provider:

  1. Create a TCP listener and start it.
  2. Create a Server Connection channel.
  3. Run the WebSphere MQ supplied MQJMS_PSQ.mqsc file to create the required JMS queues on the Websphere MQ queue manager. This .mqsc file is contained in the WebSphere MQ product install directory in the java/bin subdirectory. Run the runmqsc command, for example:
    runmqsc IB9QMGR < MQJMS_PSQ.mqsc

When you have completed the previous three steps to set the definitions, you can configure WebSphere MQ as the JMS Provider. These instructions are for a standalone server environment:

  1. Create a topic connection factory:
    1. From the Monitor Server administrative console expand Resources > JMS > JMS Providers, and select an appropriate scope from the list for your configuration.
    2. Under Resources > JMS select Topic connection factories, click New.
    3. Click WebSphere MQ messaging provider, click OK.
    4. Enter the name and JNDI name in the Name and JNDI name fields; for example, topicConn and jms/topicConn, click Next > Next.
    5. Enter the queue manager name for your Websphere MQ queue manager and click Next.
    6. Set Transport to Client.
    7. Enter the host name for where your IBM Integration queue manager is running.
    8. In the Port field, enter the port number of the TCP listener that you defined in the Websphere MQ queue manager.
    9. In the Server Connection Channel field, enter the name of the Server Connection channel.
    10. Click Next > Next > Finish.
    11. Click Save.
  2. Create a topic:
    1. Click Resources > JMS and select Topics, click New.
    2. Click WebSphere MQ messaging provider, click OK.
    3. Enter the name and JNDI name in the Name and JNDI name fields; for example, topicName and jms/topicName.
    4. In the Base Topic Name field, enter the name of the monitoring topic name. If you use the default configuration, the topic name is $SYS/Broker/IB9NODE/Monitoring/WBMonitorEventsExecGroup/TotalPurchaseOrderFlow.
    5. Click OK, click Save.
  3. Install the MDB application:
    1. In the IBM Integration Toolkit, export the MDB .zip file WBEventEmitterEAR and extract the file.
    2. Switch to the Monitor Server administrative console by clicking Applications > New Application and select New Enterprise Application.
    3. Click Browse and select the WMBEventEmitter.ear file that you extracted from the .zip file, click Next.
    4. Select Detailed - Show all installation options and parameters, click Next.
    5. Click Next.
    6. Click Next until you get to Bind listeners for message driven bean. Write down the name of the listener port.
    7. Click Next on the remaining screens; on the final summary screen, click Finish.
    8. Save the definition.
  4. Optional: If security is enabled in the monitor server:
    1. Switch to the Monitor Server administrative console by clicking Applications > Application Types > WebSphere Enterprise Applications.
    2. Click WMBEventEmitter. Under Detail Properties, select Security role to user/group mapping.
    3. Select the eventEmitter role check box, click Map users.
    4. Click Search, in the Available column, select the Administrative user that you want to map to the eventEmitter role. Click the double arrow (>>) to move the Administrative user to the Selected column and click OK.
    5. Select the eventEmitter role check box.
    6. Click OK, click Save.
    7. The selected user is now mapped to the eventEmitter role, and you must assign the user name and password to the eventEmitter role.
      1. Switch to the Monitor Server administrative console by clicking Applications > Application Types > WebSphere Enterprise Applications.
      2. Click WMBEventEmitter. Under Detail Properties, select User RunAs roles.
      3. Select the eventEmitter role check box.
      4. Enter the name and password of the user in the Username and Password fields.
      5. Click Apply. The user is displayed in the Username field beside the eventEmitter roles.
      6. Click OK, click Save.
  5. Create a listener for the MDB:
    1. Click Servers > Server Types > WebSphere Application Servers, click your server.
    2. Under the Communications section, go to Messaging > Message Listener Service > Listener Ports. Click New and enter the listener name that you wrote down when you installed the MDB application.
    3. In the Connection factory JNDI name field, enter the JNDI name that you used when you created the topic connection factory; for example, jms/topicConn.
    4. In the Destination JNDI name field, enter the JNDI name that you used when you created the topic; for example, jms/topicName.
    5. Click OK, click Save.
    6. Restart the server.
    7. Click Servers > Application Servers, click your server. Under the Communications section, go to Messaging > Message Listener Service > Listener Ports and check that the listener port is running.
    8. Under Applications > Enterprise Applications check that WMBEventEmitter is running.

Check that the event topic has a subscription registered against it for the message flow:

  1. Open the WebSphere MQ Explorer and expand queue manager IB9QMGR under the Queue Managers folder.
  2. To open the Subscriptions pane, double-click Subscriptions.
  3. Click Refresh and check that a subscription with topic string $SYS/Broker/IB9NODE/Monitoring/WBMonitorEventsExecGroup/TotalPurchaseOrderFlow exists.

The source for the MDB is included in the WMBEventEmitter.ear file. This gives an example of an MDB that can be used to:

  1. Receive event messages from Integration Node
  2. Submit them in a suitable format to the CEI server for processing by Websphere Business Monitor

The following steps describe how to import the WMBEventEmitter.ear into IBM Integration Designer 8.0.1, enabling you to view, edit and recompile the source code for the MDB.

  1. Start Websphere Integration Developer and select a workspace
  2. From the menu, select File>Import...>Java EE>EAR file and click Next
  3. Use the Browse button on the EAR file field to select the location of WMBEventEmitter.ear. When selected, the EAR Project field will be filled in as WMBEventEmitter. Check that the Target runtime field is filled in with an appropriate value for your installation. Click Finish. If you are not already in the Java EE perspective, you will be prompted to switch to that perspective. Click Yes to do so.
  4. Two projects appear in the workspace, WMBEventEmitter and WMBEventEmitterEJB.
  5. Expand WMBEventEmitterEJB>ejbModule>com.ibm.wmb.event.cbe>WMBMDBEmitterBean.java to view the source of the MDB.
  6. If you see an error reporting that The import com.ibm.events cannot be resolved, you must add com.ibm.events.client.jar to your Build Path. To do this:
    1. Right-click WMBEventEmitterEJB and select Build Path>Configure Build Path.
    2. Select the Libraries page and click Add External JARs....
    3. Navigate to the com.ibm.events.client.jar in the ${WAS_INSTALL_PATH}/plugins directory and click OK

To export the MDB for application installation:

  1. Right-click the WMBEventEmitter project and select Export>Export...Java EE>EAR file.
  2. Click Next.
  3. Use the Browse button to set the Destination field and click Finish.
  4. Proceed to the step Install the MDB application to install the MDB application on to your server.

Configure Event Sources in the message flow

The event sources have already been configured in the message flow. Double-click the TotalPurchaseOrderFlow message flow to open the Message Flow editor. Click the message flow palette. The Monitoring tab displays the five event sources that are enabled:

eventSummary

Each event definition contains a Basic, Correlation, and Sequence tab. The Basic tab defines the Event Source and Event Name. The tab also contains the options to set in Event Filter to add data from the message payload and the message bit stream. The Correlation tab defines Event Correlation information. The Sequence tab defines Event Sequence information. In this example the default settings are used for each event definition.

An event filter is set on each of the events that are defined on the InputOrder node. These filters suppress events from customers of type GUEST.

Data is captured from the message payload in three of the event definitions. Some of this extracted data is then used in the WebSphere Business Monitor Model.

InputOrderTransactionStart

The event contains the following simple elements (shown with example data) from the input message payload:

  <PO:purchaseOrderID>11112222</PO:purchaseOrderID>
  <PO:customerID>111111</PO:customerID> 

This event also contains the following complex element (shown with example data) from the input message payload:

 <PO:items>
    <PO:item>
      <PO:partNum>0239232</PO:partNum>
      <PO:productName>compost</PO:productName>
      <PO:quantity>14</PO:quantity>
      <PO:price>4.99</PO:price>
    </PO:item>
    <PO:item>
      <PO:partNum>0451481</PO:partNum>
      <PO:productName>lawnmower</PO:productName>
      <PO:quantity>10</PO:quantity>
      <PO:price>79.99</PO:price>
    </PO:item>
    <PO:item>
      <PO:partNum>0481257</PO:partNum>
      <PO:productName>spade</PO:productName>
      <PO:quantity>10</PO:quantity>
      <PO:price>19.99</PO:price>
    </PO:item>
  </PO:items>

Double-click the InputOrder MQInput node. The Basic tab shows the XPath definitions that are used to extract this data from the message payload in the Event Payload section:

$Body/PO:purchaseOrder/PO:purchaseOrderID
$Body/PO:purchaseOrder/PO:customerID
$Body/PO:purchaseOrder/PO:items	

GoldOrderTotalInTerminal and RegularOrderTotalInTerminal

Both event definitions contain the same message data that is defined in InputOrder.TransactionStart. Both event definitions also capture the data from the priceSummary element added in the ComputeTotalOrder Compute node (shown with example data):

 <PO:priceSummary>
   <PO:itemTotal>1069.66</PO:itemTotal>
   <PO:deliveryCharges>19.99</PO:deliveryCharges>
   <PO:discount>163.44</PO:discount>
   <PO:invoice>926.21</PO:invoice>
 </PO:priceSummary>	

Double-click either the GoldOrderTotal or RegularOrderTotal MQOutput node. The Basic tab shows the XPath definitions that are used to extract this data from the message payload in the Event Payload section:

$Body/PO:purchaseOrderPriced/PO:purchaseOrderID
$Body/PO:purchaseOrderPriced/PO:customerType
$Body/PO:purchaseOrderPriced/PO:priceSummary

Enable monitoring in the deployed message flow

  1. If you have not already deployed the message flow, deploy it by using the TotalPurchaseOrderArchive.bar broker archive (BAR) file.
  2. Issue the following command to enable monitoring for the deployed TotalPurchaseOrderFlow message flow:
    mqsichangeflowmonitoring IB9NODE -e WBMonitorEventsExecGroup 
    -f TotalPurchaseOrderFlow -c active

Send messages through the TotalPurchaseOrderFlow message flow

  1. In WBMonitorEventsProject, open the Flow Tests folder and double-click TotalPurchaseOrderFlow_1.mbtest.
  2. Click Invoke Message Flow.
  3. Click Send Message to send the first customer order message to the message flow input queue.
  4. In the Deployment Location window, select the WBMonitorEventsExecGroup execution group, click Finish.
  5. Repeat these steps by opening the remaining Flow Tests and submitting the remainder of the customer orders.

View the events in the WebSphere Business Monitor dashboard

Open the WebSphere Business Monitor dashboard, and switch to the dashboard that you created previously. You can see the events for the messages that you sent through the TotalPurchaseOrderFlow message flow.

Back to sample home