IBM Business Process Manager V7.5 is a comprehensive BPM platform giving you visibility and insight to manage to a full enterprise-wide program. IBM Business Process Manager harnesses complexity in a simple environment to break down silos and better meet customer needs.
WebSphere MQ (MQ) enables applications to use message queuing to participate in message-driven processing. Applications can communicate across different platforms by using the appropriate message queuing software products. For example, HP-UX® and z/OS® applications can communicate through WebSphere MQ for HP-UX and WebSphere MQ for z/OS, respectively. The applications are shielded from the mechanics of the underlying communications.
This article shows an integration scenario between MQ and a business process application deployed on Business Process Manager. The type of integration described in this article could be useful in situations in which a business process needs to be invoked when an event occurs in any disparate system not directly integrable through adapter frameworks, and requires some sort of middleware to exchange data.
The download provided with the article contains a message-driven bean (MDB) application that receives a message from MQ and forwards it to the business process application. For details on implementing the application, refer to A practical approach to integrating JMS and IBM Business Process Manager.
The process application used in this article consists of two primary components: a business process application developed in Process Designer and a J2EE™ application containing an MDB that acts as a bridge between MQ and the business process deployed on Business Process Manager. The activation specification of the MDB can be associated with the MQ queue or a listener port in WebSphere Application Server, if desired.
As shown in Figure 1, the data comes in CSV format from MQ to the MDB, which transforms it into the message format understandable by the Business Process Manager Undercover Agent (UCA) which further invokes the process.
Figure 1. Application flow architecture
Message transformation in the MDB
onMessage method receives the CSV data
in the a form of
byteMessage, which is then
tokenized and converted into a
The data is then fetched form this
and transformed into the XML message structure understood by the UCA.
Figure 2. Message conversion
To integrate the Business Process Manager application with an external MQ provider, you need to create an MQ client link in the underlying WebSphere Application Server of Business Prcess Manager, using either a Service Integration Bus (SIBus) channel or a MQ provider. This is an important step because WebSphere Application Server acts as both client and server to the external MQ provider. This configuration creates a bridge between the process deployed on Business Process Manager and MQ.
Business process application architecture
The business process application contains a human task consisting of a Coach that displays the information received from MQ. This human task interacts with the message event, which in turn is associated with the UCA. The UCA service receives the data from the MDB through its default queue in a standard format and forwards it to the task. Figure 3 shows the high-level configuration details of the business process application.
Figure 3. Business process application configuration
MQ message structure
In this article, we'll use a CSV payload to MQ. The CSV data is kept in a text file, as shown in Figure 4, which is then pushed to MQ using RFHUtil.
Figure 4. CSV file
Step 1: Configure MQ
To configure MQ on WebSphere Application Server, you'll need the following information handy:
- MQ queue manager IP address
- MQ transmission channel port, which is most often 1414. You can find this information using MQ Explorer, as shown in Figure 5.
Figure 5. MQ listener port in MQ Explorer
Once you have the required information, create the queue in WebSphere MQ as follows:
- Use MQ Explorer to configure a local queue to receive the message from
Business Process Manager. To do this, right-click the queue manager
Queue folder, as shown in Figure 6.
Figure 6. Configure the MQ queue
- Create a server connection channel in the queue manager to connect MQ
to WebSphere Application Server, as shown in Figure 7.
Figure 7. Create a server connection channel
Now that you've completed the configuration on MQ, you can proceed to configure WebSphere Application Server to connect with MQ.
Step 2: Configure the WebSphere Application Server MQ provider
In this article, we'll configure WebSphere Application Server using the MQ provider. Using the MQ messaging provider in WebSphere Application Server, Java Message Service (JMS) messaging applications can use your MQ system as an external provider of JMS messaging resources. The MQ messaging provider supports JMS 1.1 domain-independent interfaces (sometimes referred to as "unified" or "common" interfaces). This enables applications to use the same interfaces for both point-to-point and publish/subscribe messaging, and also enables both point-to-point and publish/subscribe messaging within the same transaction. With JMS 1.1, this approach is considered good practice for new applications. The domain-specific interfaces are supported for backwards compatibility for applications developed to use domain-specific queue interfaces, as described in section 1.5 of the JMS 1.1 specification.
To configure the provider, do the following:
- Configure the Queue Connection Factory by clicking Resources =>
JMS =>JMS providers, and selecting the MQ messaging
provider for the Queue Connection Factory you want to configure, as
shown in Figure 8.
Figure 8. Select the MQ messaging provider
- Change the Scope setting to the level at which the connection factory is visible to applications.
- In the contents pane, under Additional Properties, click Queue connection factories to display a table of existing queue connection factories, with a summary of their properties.
- Create a new connection factory, as shown in the Figure 9, by
specifying the name, JNDI name, queue manager, host, port and channel
Figure 9. Configure queue connection factory
- To configure the queue, click Resources => JMS =>JMS providers in the navigation pane, and select the MQ messaging provider for the queue destination that you want to configure.
- Change the Scope setting to the level at which the JMS destination is visible to applications.
- In the contents pane, under Additional Properties, click
Queues to display a table of existing queue destinations
with a summary of their properties. Create a new queue, as shown in
Figure 10, by specifying the name, JNDI name, queue and queue manager
Figure 10. Configure the queue
You've now completed the basic MQ configuration of Business Process Manager and are ready to create and configure the application.
Step 3: Configure the MDB
There are two options provided by MQ to configure MDBs: activation specifications and listener ports. We'll use the activation specification method. To configure the activation specification, select Resources => JMS => Activation specifications, as shown in Figure 11. You must do this before installing the MDB EAR.
Figure 11. Configure the activation specification
Once the activation specification is configured, install the EAR and associate the destination JNDI and activation specifcation JNDI with the MDB, as shown in Figure 12.
Figure 12. Configure the activation specification in EAR
Step 4: Invoke the application
Now that the configuration is complete, you're ready to test the application. The CSV data is sent to MQ queue through the MQ RFHUtil utility, as shown in Figure 14. In a real-world environment, however, this data could be coming from other software systems.
Figure 13. Sending CSV data through RFHUtil
Step 5: Verify the results in Process Portal
Once the message is written to the ExampleQueue, you can log in to the Process Portal as admin. In the inbox, you should see the new process instance that was created as a result of the message, as shown in Figure 15. If you click the green arrow icon to run the process instance, you should see the the data received from the client, as shown below.
Figure 14. The invoked process
This article described how to integrate WebSphere MQ with IBM Business Process Manager V7.5 using the Undercover Agent.
|Project interchange file||MQUCATest.zip||7KB|
- IBM Business Process Manager 7.5 Information Center
- WebSphere MQ Information Center
- IBM Business Process Manager product information
- JMS 1.1 specification
- 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.