WebSphere Operational Decision Management (hereafter called ODM) enables businesses to respond to real-time data with intelligent, automated decisions. It consists of two complementary components, Decision Server Rules and Decision Server Events. Depending on business data types and business requirements, Decision Server Events can be used to provide decision management services. Because Decision Server Events is the new version of WebSphere Business Events, WebSphere Business Events V7 users may want to migrate their solutions to ODM to leverage new tools and features.
You can configure either a standalone or highly available and scalable Decision Server events environment. One approach to creating a highly available and scalable events environment is to use application server clustering to provide workload management and failover for applications that reside on the cluster. In this article, we'll create a clustered Decision Server events environment. Refer to Part 1 for the steps to build a standalone environment.
To benefit from this article, readers should have a fundamental understanding of WebSphere ODM and WebSphere Application Server products. For more information on these products, see Resources.
Create a Decision Server Events runtime
Refer to the WebSphere Operational Decision Management Information Center for a silver topology and a golden topology for a highly available and scalable Decision Server Events runtime (hereafter called event runtime). In either topology, the default messaging (the application server SIBus) is used as the JMS provider. In the topology shown in Figure 1, WebSphere MQ is used as the JMS provider and DB2® is used for the event runtime repository. MQ and DB2 servers are hosted on separated machines. The event runtime environment is created on an application server cluster across two hosts, which provide mission-critical services to ensure minimal downtime and maximum scalability. A cluster is a group of application servers that transparently run the event runtime, a Java™ EE application, as if it were a single entity. Multi-instance queue managers along with client channel definition table (CCDT) could be used for the messaging failover by automatically switching to a standby MQ server if the active server fails. DB2 high availability disaster recovery (HADR) could be used for the data source failover. The DB2 HADR is a data replication feature that provides a high availability solution for both partial and complete site failures. Creating multi-instance queue managers and configuring DB2 HADR are outside the scope in this article.
Figure 1. An event runtime topology using MQ and DB2
For the sake of simplicity, we'll build an event runtime environment on one Windows® machine, as shown in Figure 2. ODM, MQ and DB2 are all installed on the machine. One cluster DseCluster1 contains the two managed nodes (custom profiles augmented with Decision Server Events) DseNode1 and DseNode2, which are federated into a cell DseCell1 of a deployment manager DseDmgr1. Table 1 lists the prerequisite software and installation information.
Figure 2. Logical view of the event runtime environment
Table 1. Software installation information
| System | Parameter | Value |
|---|---|---|
| WebSphere ODM | Version Host Install_Dir WAS_Dir UserID | 7.5 localhost C:\IBM\WODM75 C:\IBM\WODM75\WAS admin |
| WebSphere MQ | Version Host Install_Dir UserID | 7.0.1 localhost C:\IBM\MQV70 admin |
| DB2 | Version Host Install_Dir Server_Port UserID | 9.7 localhost C:\IBM\SQLLIB 50000 admin |
Before creating the event runtime, you need to create a database and a queue manager as follows:
- Create a database called
DSEDB1by entering the following DB2 Command Line Processor (CLP) command:db2 create database DSEDB1 using codeset UTF-8 territory us PAGESIZE 32768
- Create a queue manager DSEQM1 along with a listener and pub/sub JMS
objects using the following commands:
crtmqm DSEQM1 strmqm DSEQM1 echo DEFINE LISTENER('DSEQM1_TCP') TRPTYPE(TCP) PORT(2414) CONTROL(QMGR) | runmqsc DSEQM1 runmqsc DSEQM1 < C:\IBM\MQV70\java\bin\MQJMS_PSQ.mqsc
After the database and the queue manager are successfully created, follow the steps described below to create the event runtime.
- Create and augment a deployment manager profile
- Create and augment custom profiles
- Federate the custom profiles into the cell of the deployment manager
- Create a cluster and add the application servers as cluster members
- Start the deployment manager, the node agents and the cluster
- Install the event runtime application
- Create a JVM custom property
- Enable the startup bean service
- Create DSE tables
- Create MQ queues
- Configure Business Space
Create and augment a deployment manager profile
Run the following command to create a deployment manager profile called DseDmgr1.
C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -create -templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\management" -profileName "DseDmgr1" -profilePath "C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1" -hostName "localhost" -cellName "DseCell1" -enableAdminSecurity "true" -adminUserName "admin" -adminPassword "p@ssw0rd" |
You also can use the Profile Management Tool to create the deployment manager profile. For the WebSphere Application Server Information Center for information on how to create a management profile with a deployment manager.
Run the following command to augment the deployment manager profile with Decision Server Events.
C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -augment -profileName "DseDmgr1" -templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\wbe\management" -wbeDbType "DB2_Universal" -wbeDbHostName "localhost" -wbeDbServerPort "50000" -wbeDbJDBCClasspath "C:\IBM\SQLLIB\java\db2jcc.jar" -wbeDbName "DSEDB1" -wbeDbUserId "admin" -wbeDbPassword "p@ssw0rd" -wbeHome "C:\IBM\WODM75\WODM" -wbeMsgingType "MQ_JMS_Messaging" -wbeMqMsgingQmgrName "DSEQM1" -wbeMqMsgingQmgrHostName "localhost" -wbeMqMsgingQmgrPort "2414" -wbeMqMsgingTransType "CLIENT" |
Note that the MQ transport type can be BINDINGS or CLIENT. To connect to a queue manager in bindings mode, a JMS application must run on the same system on which the queue manager is running and connect directly to the queue manager using the Java Native Interface (JNI). To connect to a queue manager in client mode, a JMS application can run either on the same system on which the queue manager is running or on a different system. In each case, the JMS application connects to the queue manager over TCP/IP. If the multi-instance queue managers are used for failover, the type must be CLIENT so that CCDT on a channel can be set.
You also can use the Profile Management Tool to augment the deployment manager profile. Refer to the in WebSphere Operational Decision Management Information Center for information how to augment a management profile with Decison Server Events.
After the deployment manager profile is successfully created and augmented, start the application server and open the administrative console. You should see:
- A deployment manager dmgr under System administration => Deployment manager.
- A data source Event Runtime Datasource under Resources => JDBC => Data sources. This data source is associated with the database DSEDB1.
- A set of JMS objects, such as the topic connection factory WbeTopicConnectionFactory under Resources => JMS => Topic connection factories, the queue eventQueue under Resources => JMS => Queues, the topic actionTopic under Resources => JMS => Topics, and the activation specification wbe_events under Resources => JMS => Activation specifications.
- A set of Decision Server Events custom properties under Resources => Resource Environment => Resource environment entries => WbeSrv01 => Custom properties.
Create and augment custom profiles
Run the following command to create a custom profile called DSE1.
C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -create -templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\managed" -profileName "DSE1" -profilePath "C:\IBM\WODM75\WAS\AppServer\profiles\DSE1" -nodeName "DseNode1" -hostName "localhost" -enableAdminSecurity "true" -adminUserName "admin" -adminPassword "p@ssw0rd" |
Run the following command to augment the custom profile with Decision Server Events.
C:\IBM\WODM75\WAS\AppServer\bin>manageprofiles.bat -augment -profileName "DSE1" -templatePath "C:\IBM\WODM75\WAS\AppServer\profileTemplates\wbe\managed" |
Repeat both commands to create and augment another custom profile DSE2.
Federate the custom profiles into the cell of the deployment manager
Start the deployment manager if not already started, and run the following commands to federate the DSE1 and DSE2 custom profiles into the cell of the deployment manager.
C:\IBM\WODM75\WAS\AppServer\bin>addNode.bat localhost 8879 -profileName "DSE1"
-username admin
-password p@ssw0rd
C:\IBM\WODM75\WAS\AppServer\bin>addNode.bat localhost 8879 -profileName "DSE2"
-username admin
-password p@ssw0rd
|
where:
8879 is the deployment manager's
SOAP_CONNECTOR_ADDRESS port number and
localhost is the host name where the deployment manager is
running.
Create a cluster and add the application servers as cluster members
Run the following commands to create a cluster called DseCluster1 in the DseCell1 cell and then add the cluster members DseSrv1 and DseSrv2 in the cluster.
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
-username admin
-password p@ssw0rd
wsadmin>cell1 = AdminConfig.getid('/Cell:DseCell1/')
wsadmin>AdminConfig.create('ServerCluster', cell1, '[[name DseCluster1]]')
wsadmin>AdminConfig.save()
wsadmin>cluster1 = AdminConfig.getid('/ServerCluster:DseCluster1/')
wsadmin>node1 = AdminConfig.getid('/Node:DseNode1/')
wsadmin>node2 = AdminConfig.getid('/Node:DseNode2/')
wsadmin>AdminConfig.createClusterMember(cluster1, node1, [['memberName', 'DseSrv1']])
wsadmin>AdminConfig.createClusterMember(cluster1, node2, [['memberName', 'DseSrv2']])
wsadmin>AdminConfig.save()
wsadmin>exit
|
Start the deployment manager, the node agents, and the cluster
After completing the previous step, the deployment manager and the node agents should be up and running. If not, run the following commands to start the deployment manager and the node aganets for DSE1 and DSE2.
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>startManager C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>startNode -profileName DSE1 C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>startNode -profileName DSE2 |
Run the following commands to start the cluster:
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
-username admin
-password p@ssw0rd
wsadmin>cluster1 = AdminControl.completeObjectName('cell=DseCell1,
type=Cluster,
name=DseCluster1,*')
wsadmin>AdminControl.invoke(cluster1, 'start')
wsadmin>exit
|
If you want to stop the cluster, the node agents, and the deployment manager, run the following commands.
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
-username admin
-password p@ssw0rd
wsadmin>cluster1 = AdminControl.completeObjectName('cell=DseCell1,
type=Cluster,
name=DseCluster1,*')
wsadmin>AdminControl.invoke(cluster1, 'stop')
wsadmin>exit
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>stopNode -profileName DSE1
-username admin
-password p@ssw0rd
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>stopNode -profileName DSE2
-username admin
-password p@ssw0rd
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>stopManager -username admin
-password p@ssw0rd
|
Install the event runtime application
The event runtime application file wberuntimeear.ear is located in the C:\IBM\WODM75\WODM\director\lib directory. Make sure that the deployment manager, the node agents, and the cluster are all started. Run the following commands to install the application.
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
-username admin
-password p@ssw0rd
wsadmin>AdminApp.install('C:/IBM/WODM75/WODM/director/lib/wberuntimeear.ear',
'[-cluster DseCluster1]')
wsadmin>AdminConfig.save()
wsadmin>sync1 = AdminControl.completeObjectName('type=NodeSync,node=DseNode1,*')
wsadmin>sync2 = AdminControl.completeObjectName('type=NodeSync,node=DseNode2,*')
wsadmin>AdminControl.invoke(sync1, 'sync')
wsadmin>AdminControl.invoke(sync2, 'sync')
wsadmin>exit
|
The event runtime requires that a JVM custom property called wbe.home is
configured with a value that is the location of the directory
director in the Decision Server Events installation (in this
case, C:\IBM\WODM75\WODM\director).
To create the JVM custom property for each application server in the cluster, run the following commands:
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
-username admin
-password p@ssw0rd
wsadmin>server1 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode1/Server:DseSrv1')
wsadmin>server2 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode2/Server:DseSrv2')
wsadmin>jvm1 = AdminConfig.list('JavaVirtualMachine', server1)
wsadmin>jvm2 = AdminConfig.list('JavaVirtualMachine', server2)
wsadmin>attr = []
wsadmin>attr.append([['name','wbe.home'],['value','C:\\IBM\\WODM75\\WODM\\director']])
wsadmin>AdminConfig.modify(jvm1,[['systemProperties',attr]])
wsadmin>AdminConfig.modify(jvm2,[['systemProperties',attr]])
wsadmin>AdminConfig.save()
wsadmin>exit
|
You should see the wbe.home property in the administrative console, as shown in Figure 3.
Figure 3. New custom property
You may need to configure the heap size and the JVM garbage
collection value to optimize the usage of memories. For example, set both
Initial Heap Size and Maximum Heap Size to 1024 and set Generic JVM
Arguments to -Xgcpolicy:gencon -Xmn1024M.
Enable the startup beans service
You also need to enable the startup beans service for each application server in the cluster. To enable the startup bean service, run the following commands.
C:\IBM\WODM75\WAS\AppServer\profiles\DseDmgr1\bin>wsadmin -lang jython
wsadmin>server1 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode01/Server:DseSrv1')
wsadmin>server2 = AdminConfig.getid('/Cell:DseCell1/Node:DseNode02/Server:DseSrv2')
wsadmin>sbs1 = AdminConfig.list('StartupBeansService', server1)
wsadmin>sbs2 = AdminConfig.list('StartupBeansService', server2)
wsadmin>AdminConfig.modify(sbs1, [['enable', 'true']])
wsadmin>AdminConfig.modify(sbs2, [['enable', 'true']])
wsadmin>AdminConfig.save()
wsadmin>exit
|
You should see the Enable service at server startup checked in the administrative console, as shown in Figure 4.
Figure 4. Enabling the startup beans service
Create the event runtime tables
Decision Server Events provides the scripts used to create the event runtime tables in the C:\IBM\WODM75\WODM\config\db directory. Run the following DB2 CLP commands to create the event runtime tables.
cd C:\IBM\WODM75\WODM\config\db db2 connect to DSEDB1 db2 -tcf db2.sql |
You should see a set of tables for the event runtime created in the DSEDB1 database, as shown in Figure 5.
Figure 5. The event runtime tables
Decision Server Events provides the script create_MQ_JMS_MQ_queues.mqsc used to create the MQ queues in the C:\IBM\WODM75\WODM\config\was directory. Run the following MQ script command to create the queues.
cd C:\IBM\WODM75\WODM\config\was runmqsc DSEQM1 < create_MQ_JMS_MQ_queues.mqsc |
Three queues, eventQueue, durableEventQueue and historyModuleQueue, are created in the DSEQM1 queue manager, as shown in Figure 6.
Figure 6. The queues for the messaging destinations
Business Space is the browser-based graphical user interface that enables business users to interact with content provided by ODM and other WebSphere products. It hosts the design authoring tool, the Decision widget, so that the policy managers and rule authors can author event rules. You can create a Business Space in the cluster environment. Refer to the Operational Decision Management Information Center for information on how to Configure Business Space for high availability and scalability.
Verify the event runtime system
After a few seconds, the cluster DseCluster1, the application servers DseSrv1 and DseSrv2, and the application wberuntimeear should all be running.
Alternatively, to start the cluster on the administrative console, select Servers => Clusters => WebSphere application server clusters, then select DSECluster1, and click Start.
Complete the following steps to verify the event runtime.
- Make sure that the DB2 server and the MQ queue manager are started.
- Start the deployment manager, the node agents and the cluster. Open the administrative console and make sure that they are all started successfully.
- Download the MeterReadings event project from the ODM Information Center. In the MeterReadings project, the current and previous values of meter readings are compared. If the latest meter reading is less than the previous one, an action is triggered.
- Open the Event perspective on Event Designer. Create an event runtime
connection as shown in Figure 7. Use port number 9080 for DseSrv1.
Note that you can also create an event runtime connection to DseSrv2
(port number 9081). Both are connected to the same event runtime
repository.
Figure 7. Create a new event runtime connection
- Deploy the event project to the event runtime by selecting Deploy
from project file, as shown in
Figure 8.
Figure 8. Deploy a project
- Open MQ Explorer. Expand the queue manager DSEQM1, right-click
Topic
and select Test subscription, as shown in Figure 9.
Figure 9. Open test subscription
- Enter
actionTopicin the Topic field and click Subscribe to subscribe the topic, as shown in Figure 10.
Figure 10. Subscribe to actionTopic
- Put an event test message in the eventQueue queue using MQ Explorer,
as shown in Figure 11.
Figure 11. Put an event test message in the queue
The test message is listed here:
<?xml version="1.1" encoding="UTF-8"?> <connector name="WBE" version="6.2" xmlns="http://wbe.ibm.com/6.2/Event/New-meter-reading"> <connector-bundle name="New meter reading" type="Event"> <SmartMeter-data> <Customer-ID type="String">12345</Customer-ID> <meter-reading type="Real">1000</meter-reading> <meter-reading-date type="DateTime">2012-05-25T20:03:10Z< /meter-reading-date> </SmartMeter-data> </connector-bundle> <system>VMXP03</system> <timestamp>2012-05-25T16:03:10.569-04:00</timestamp> <loginfo>This is an event from Decision Server</loginfo> </connector>
Change the meter-reading value from 1000 to 800 in the test message and put it in the queue again.
- Check that an action is published as shown in Figure 12.
Figure 12. The action message published by the event runtime
This article described the steps to create a highly available and scalable event runtime environment. Though we built this environment on a single Windows machine, the commands and scripts provided can be used to build the topology across multiple machines as shown in Figure 1 and on other platforms, such as AIX. To build a real-world event runtime production environment, you'll need to performa additional configuration, such as user roles and user authentication.
- IBM WebSphere Operational Decision Management V7.5 Information
Center
- IBM
WebSphere Application Server V7 Information Center
- Making
Better Decisions Using IBM WebSphere Operational Decision
Management, IBM Redbook
- WebSphere Operational Decision Management Product Demo
This 9-minute demo introduces the main concepts of WebSphere Operational Decision Management
for both business and IT users. You'll see how you can manage business
rules and events in a business environment.
- Installing and setting up WebSphere Operational Decision
Management (WebSphere ODM Information Center)
-
developerWorks
BPM zone: Get the latest technical resources on IBM BPM
solutions, including downloads, demos, articles, tutorials,
events, webcasts, and more.
-
IBM
BPM Journal: Get the latest articles and columns on BPM
solutions in this quarterly journal, also available in both Kindle
and PDF versions.
Shenfu (Mike) Fan is a Senior Managing Consultant with IBM Software Services for WebSphere (ISSW). He is primarily focused on architectural design, development, and implementation of enterprise application integration solutions using WebSphere products that include WebSphere Message Broker, WebSphere MQ, WebSphere Business Events, WebSphere Service Registry and Repository, WebSphere ESB, and others.




