IBM Integration Bus: MQ Flexible Topologies: Configuring MQ Nodes Using MQ Connection Properties
IBM Integration Bus: MQ Flexible Topologies: Configuring MQ Nodes Using MQ Connection Properties
MQ Flexible Topologies:
Configuring MQ nodes
using
MQ Connection Properties
Featuring:
January 2016
Hands-on lab built at product
Version 10.0.0.3
IBM Integration Bus V10 Workshop January 2016
1. INTRODUCTION ............................................................................................................................ 3
5.1 CONFIGURE THE MQ NODES TO USE A DIFFERENT LOCAL QUEUE MANAGER ........................... 34
5.1.1 Configure the MQ Provider application ........................................................................... 35
5.1.2 Configure the MQ Client application ............................................................................... 36
5.2 TEST THE SCENARIO USING THE FLOW EXERCISER .................................................................. 37
5.3 VERIFY THE CONNECTION TO THE QUEUE MANAGER (SERVER CONNECTION) .............................. 41
1. Introduction
This lab guide covers the flexible MQ topologies available in IBM Integration Bus V10.
IBM Integration Bus V10 permits direct access to messages on any queue manager using:
In this lab guide you will configure two MQ applications to show how MQ queues can be accessed on
queue managers where:
1) The queue manager is defined with the Integration Node (you will cover this in Scenario 1: Using
an IIB node with an associated queue manager on page 19):
2) The queue manager is local to the Integration Node (Bindings connection) but not defined as the
Integration Node queue manager. You will cover this in Scenario 2: IIB node with no
associated queue manager: Using an MQ SERVER connection on page 34 :
3) The queue manager is remote to the Integration Node (MQ Client connection). You will cover this
in Scenario 3: IIB node with no associated queue manager: Using an MQ CLIENT
connection on page 45 :
Important note
This lab, version 10.0.0.3, has been updated significantly from earlier versions. The
following changes have been made:
You should use the Windows user "iibuser". This user is a member of mqbrkrs and mqm,
but is not a member of Administrators. The user "iibuser" can create new IIB nodes and
do all required IIB development work. However, installation of the IIB product requires
Administrator privileges (not required in this lab).
The database has been changed from the DB2 SAMPLE database to the DB2 HRDB
database. HRDB contains two tables, EMPLOYEE and DEPARTMENT. These tables have
been populated with data required for this lab. (The DDL for the HRDB is available in the
student10 folder; we intend to provide corresponding DDL for Microsoft SQL/Server and
Oracle over time).
The map node now retrieves multiple rows from the database, using an SQL "LIKE"
function . Additionally, the map has been refactored to use a main map and a submap.
Both the main map and submap are located in a shared library.
Input to the integration service is now a simple schema containing just one element, the
required employee number.
As a consequence, this version of the lab, and the associated solution, can only be used
with the corresponding changes in other labs. Use version 10.0.0.3 of all labs in this
series of lab guides.
The Provider application obtains requests and provides responses using queues. The client is driven
by providing JSON data to a URL controlled by an HTTP input node and provides a JSON based
response over http.
NOTE: The applications are provided purely to show (within the context of this
workshop).
The applications only work as expected when one user is submitting requests in a
controlled way. A more complex Request/Response message correlation Pattern is
available in the Patterns gallery, however is out of the scope of this lab guide.
The function of the EmployeeMQProvider application is to retrieve Employee details from the HRDB
database.
It will use two queues (MQREQUEST and MQRESPONSE) to handle requests and provide the
responses. Request data from MQREQUEST queue is passed to a mapping node,
getEmployee_XML. The Mapping node uses XML data passed in the request to obtain details of the
employee from the EMPLOYEE table in the database and provides XML Response data. The
Response data is then written to a queue called MQRESPONSE.
The Mapping node is supplied in a Shared Library. The lab guide will demonstrate how to reuse
assets previously created and stored in a Shared Library in IIB V10.
In this section you will complete the application by configuring the message flow to process the MQ
messages written to the queue MQREQUEST by the MQ Client application.
You will then configure the message flow to reuse the “getEmployee_XML” map. This map invokes
the getEmployees submap.
If you have already done Lab 1 in this series (create an Integration Service), you can
skip straight to "Prepare your workspace" on the next page.
To run this lab, the Integration Bus node must be enabled to allow a JDBC connection to the
HRDB database.
1. Open an IIB Command Console (from the Start menu), and navigate to
c:\student10\Create_HR_database
Accept the defaults presented in the script. This will create the required JDBC
configurable service for the HRDB database.
4. Stop and restart the node to enable the above definitions to be activated
mqsistop TESTNODE_iibuser
mqsistart TESTNODE_iibuser
This will create the necessary security credentials enabling TESTNODE_iibuser to connect to the
database.
If you already have a workspace open, click File, Switch Workspace. Give the new
workspace the name
c:\users\iibuser\IBM\IIB 10\workspace_MQTop
Import all projects in the PI file. Your workspace will be updated and look like this:
In the Integration Toolkit, in the Integration Nodes pane, right-click and select Delete, All Flows and
Resources.
1. In the IIB Toolkit, in the Integration Nodes pane, right-click TESTNODE_iibuser, and select
Change.
2. In the Change Integration Node window, specify the queue manager name IB10QMGR.
Click Finish.
In the Node Palette, open WebSphere MQ and add an MQInput Node then add MQOutput
node as follows:
5. Click the MQInput node. In the Properties (Basic tab), specify a queue name MQREQUEST:
6. On the Input Message Parsing tab, change the Message domain to XMLNSC:
7. Click the MQOutput node and specify a queue name of “MQRESPONSE” on the Basic tab:
8. Click the (new in V10) MQ Connection tab to show the MQ Connection properties available
for the output node:
The default specification for the connection details for the queue is that messages will be
written via the queue manager associated with the Integration Node.
Specifying “Local queue manager” option for “Connection” and no value in “Destination
queue manager name” implies that the queue exists on the Integration Node queue
manager.
9. Select “Local queue manager” to show the options available for the Connection:
With IIB V10 you can specify that the queue exists:
I. On the (local) queue manager defined with Integration Node (leave the “Destination
queue manager name” blank)
II. On a local queue manager (specify the name of the queue manager in “Destination
queue manager name”)
IV. On a remote queue manager where connection properties are defined in a Client
channel definition table (CCDT)
We will revisit the different connection options on this tab later in the lab guide.
10. Check the Connection details on the MQInput, called “Read Request”, you will see the
same default MQ Connection settings:
Call the Mapping node “getEmployee_XML” and connect the terminals as shown:
On the Basic tab, click the Browse button to specify an existing mapping routine:
4. The properties will change to use the existing map from the Shared Library
EmployeeService_interface_and_maps.
5. In the flow editor, double click on the map node you just dropped on the flow editor
(getEmployee_XML).
In the map editor, you will see there is no reference to the transport protocol that is being
used (eg. SOAP, REST). This is because the input and output messages will be simply XML
messages, represented by the employeeNumber and EmployeeResponse messages.
Note that this map uses a common submap to retrieve the data from the database.
You will use this trace node to identify the effects of changes in the MQ Connection tab in the
Flow Exerciser tool.
2. In the message flow, click the “Submit Request” MQOutput node to show the properties of
the node:
3. In IIB V10 the Basic tab now contains only the queue name to be used by the MQOutput
node:
4. The queue manager connection details are now specified on the MQ Connection tab:
Ensure the same settings are specified that were configured for the MQInput node in the
getEmployeeDetails message flow in the EmployeeMQProvider Application (i.e. ensure there
is nothing specified in the “Destination queue manager name” and specify “Local queue
manager” as the Connection).
5. Click the MQGet node called “Process Response” to show its properties.
(Note that the MQGet node has exactly the same MQ Connection options available and is
configured to use the queue manager defined on the Integration Node):
Earlier in the lab, you configured TESTNODE_iibuser to use IB10QMGR as its local queue manager
in the same way that previous releases of IIB were configured. You will see how MQ flow nodes are
now configured to use this configuration in IIB V10.
The queues used by the MQOutput and the MQGet node are already defined on queue manager
IB10QMGR. However in order to function correctly the EmployeeMQProvider must be deployed.
You will use the Flow Exerciser to test this scenario. The Flow Exerciser automatically deploys
applications and any pre-requisite Shared Libraries needed by the applications.
3. If you have more than one Integration Node defined and running, select “default” on
“TESTNODE_iibuser” in the “Select Integration Server” dialog:
The Flow Exerciser will build and deploy a test bar file with the required resoures for the
application to run.
4. If you are prompted with the “Ready to record message”, click close:
5. The canvas background in the message flow editor will grey out, indicating that the message
flow is ready to record data sent through it:
6. Note a record icon now appears on the getEmployeeDetails message flow in the Integration
Nodes view :
7. Now switch to the open message flow JSON_MQClient.msgflow and repeat the steps above
until the message flow is in record mode:
The message flow will now show the route the message took through the message flow (the
connectors will be green).
Each connection between the nodes will display an envelope icon. Clicking this icon will
display the contents of the recorded message at that point in the flow.
Click the envelope between the MQOutput node (“Submit Request”) and MQGet nodes
(“Process Response”):
2. A yellow popup window will open with the title “Recorded Message”.
Note the details in “DestinationData” reflect the details used by the MQOutput node:
Click the icon to view the path the message took through this flow:
5. Note the green line highlighting the path the message took through the message flow.
Click on the envelope icon on the connector between the MQOutput node and the MQ
Provider Trace Node:
6. In the Recorded Message popup window expand Local Environment to verify the
DestinationData. Note the bindingtype, DestinationQueueManager details reflect those
defined on the MQ Connections tab for the MQOutput node:
8. Return the message flow to edit mode by clicking the “Return flow to edit mode” button:
9. If you get one, dismiss the warning that the action will clear all recorded messages from the
message flow.
10. Repeat the above step on JSON_MQClient.msgflow to return that flow to edit mode.
You will now configure the applications provided with this lab guide to run on separate IIB nodes. Both
IIB nodes will be created without specifying a queue manager (no “–q” option).
The MQREQUEST and MQRESPONSE queues will be defined on a queue manager which is
independent of the two IIB nodes.
The MQ applications will be configured to access these queues by configuring the queue manager
(on which they are defined) as:
1) A local queue manager configuration specified on the MQ Connection tab for the MQ
nodes:
2) A (remote) MQ client configuration specified on the MQ Connection tab for the MQ nodes
1. In the Integration Nodes view, right click on “Integration Nodes” and select New > Local
Integration Node:
2. In the Create a new local Integration Node window specify the following and click finish:
(Note: do not specify a default queue manager)
3. Repeat the above process and create a local Integration Node called IB10NODE_PMQ with
server MQPROVIDER.
4. Stop the TESTNODE_iibuser node (right click on the node and select stop).
5. The list of nodes in the Integration Nodes view should now look like this:
C:\student10\MQ_Topology\commands
This script configures the environment for the MQ applications to run successfully by
configuring the JDBC, ODBC and security for the Provider node to access the EMPLOYEE
table in the HRDB database.
When the script has successfully completed, the two Integration Nodes you created earlier:
and
should still be running (right click on the node and click refresh to update the Integration
Nodes view).
You will configure the Provider application to obtain requests from MQREQUEST and write
Responses to MQRESPONSE on the queue manager “QM2” (QM2 is independent of the IIB nodes
you will deploy the applications to, however it is defined on the same machine enabling the MQ nodes
in the applications to communicate with the queue manager using Server bindings mode).
Similarly the MQ application acting as a Client in this scenario will be configured to write requests to
MQREQUEST on QM2 and read the responses from MQRESPONSE on QM2, using a server
bindings mode connection to the queue manager.
On the MQ Connection tab, specify QM2 in the “Destination queue manager name” field:
2. Repeat the previous step for the MQOutput node called “Write Response”:
1. In the JSON_MQClient message flow, click the “Submit Request” MQOutput node to show
the properties tab.
In the MQ Connection Tab specify that the queue exists on a local queue manager called
QM2:
2. Click the “Process Response” MQGet node and perform the same change:
4. The canvas background in the message flow editor will grey out, indicating that the message
flow is ready to record data sent through it:
8. Note that both message flows (in both IIB nodes) will be now be shown to be in record mode
in the Integration Nodes view:
10. In the Send Message window, expand Input Messages and highlight “User 000010” and click
Send. (This will inject a message into the message flow exercising the nodes in the flow.
Note the message details contains the JSON to find user with a key of “000010”):
11. The “Progress Information” window will open. When the line “Received HTTP reply message
for HTTP Input” appears, the flow has completed.
You will see the response from the database look up using the key “000010”:
The message flow will now show the route the message took through the message flow (a
line in green).
Click the envelope icon between the MQOutput node “Submit Request” and the MQGet node
“Process Response”:
Note the details in “DestinationData” reflect the properties saved with the MQOutput node
“Submit Response” :
The MQ Client application has written the data to the MQREQUEST queue using a SERVER
(Bindings) connection to QM2.
3. Switch to the getEmployeeDetails message flow and click the “Show message path
through the message flow” button:
4. The Flow Exerciser will show the path that the message took through this flow in green.
Click the envelope between the MQOutput node and the Trace node.
5. In the Recorded Message window, expand “Local Environment” to see the details of where
the application wrote the MQ details to:
As with the JSON_MQClient flow, the MQProvider application also wrote directly to the
MQRESPONSE queue on QM2, using SERVER bindings.
6. Expand the Message section (to XMLNSC) to show the details returned from the
getEmployee_XML map.
7. If the Flow Exerciser is recording messages, it is not possible to edit a message flow. In the
next section you will re-configure the MQ nodes in the message flow.
An MQ Client “server conn” definition and a TCP listener (running on port 1442) have already been
defined on QM2.
The configuration for this scenario is similar to the previous scenario, however you will configure the
MQ Connection properties for both the applications to use an MQ Client connection. The MQ Client is
already installed on your prebuilt environment.
You will configure the environment to simulate the following (note the prebuilt Lab environment all IIB
nodes and queue managers are located in a single virtual machine):
2. Repeat the above step for the MQGet node called “Process Response”.
The properties tab should look like this (the same as above):
2. Click the MQOutput node “Write Response” and configure the MQ Connection properties as
above:
3. The canvas background in the message flow editor will grey out, indicating that the message
flow is ready to record data sent through it:
7. In the Send Message window, expand Input Messages and highlight “User 000010” and click
Send:
When the line “Received HTTP reply message for HTTP Input” appears, highlight the line to
see the received data. You will see the response from the database look up using the key
“000010”:
The message flow will show the route the message took through the message flow (a line in
green).
Click the envelope icon between the “Submit Request” MQOutput node and the MQGet node
called “Process Response”:
2. When the “Recorded Message” (yellow background) popup appears, expand Local
Environment.
Note the details in “DestinationData” reflect the properties saved with the MQOutput node
“Submit Response”:
The MQ Client application has written the data to the MQREQUEST queue using a CLIENT
connection to QM2.
3. Switch to the getEmployeeDetails message flow and click the show message path through
the message flow button:
4. The Flow Exerciser will show the path that the message took through this flow in green.
Click on the envelope between the MQOutput node and the MQ Provider trace:
5. In the Recorded Message window, expand “Local Environment” to see the details of where
the application wrote the MQ details to:
The MQProvider application also wrote the message to the MQRESPONSE queue using a
client connection to QM2.