0% found this document useful (0 votes)
69 views53 pages

IBM Integration Bus: MQ Flexible Topologies: Configuring MQ Nodes Using MQ Connection Properties

This document describes configuring MQ nodes in IBM Integration Bus to use flexible MQ topologies. It presents three scenarios: 1) An IIB node with an associated queue manager, 2) An IIB node using a local queue manager without association, and 3) An IIB node using a remote queue manager without association. Each scenario configures and tests MQ client and provider applications to access queues on different queue managers. The goal is to demonstrate the flexibility of MQ access in IIB V10 using local bindings, local MQ client, or remote client connections.

Uploaded by

diva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views53 pages

IBM Integration Bus: MQ Flexible Topologies: Configuring MQ Nodes Using MQ Connection Properties

This document describes configuring MQ nodes in IBM Integration Bus to use flexible MQ topologies. It presents three scenarios: 1) An IIB node with an associated queue manager, 2) An IIB node using a local queue manager without association, and 3) An IIB node using a remote queue manager without association. Each scenario configures and tests MQ client and provider applications to access queues on different queue managers. The goal is to demonstrate the flexibility of MQ access in IIB V10 using local bindings, local MQ client, or remote client connections.

Uploaded by

diva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

L06

IBM Integration Bus

MQ Flexible Topologies:
Configuring MQ nodes
using
MQ Connection Properties

Featuring:

• Running MQ applications on IIB Nodes with and without an


associated queue manager
• Reuse of Graphical Data Maps stored in Shared Libraries
• Configuring MQ node connection properties in Toolkit
• IIB Flow Exerciser testing
• Bindings and Client connections to MQ queue managers

January 2016
Hands-on lab built at product
Version 10.0.0.3
IBM Integration Bus V10 Workshop January 2016

1. INTRODUCTION ............................................................................................................................ 3

1.1 THE MQ BASED APPLICATIONS.................................................................................................. 6


1.1.1 The Provider application .................................................................................................... 6
1.1.2 The Client application ........................................................................................................ 7

2. COMPLETE THE PROVIDER APPLICATION .............................................................................. 8

2.1 CONFIGURE INTEGRATION BUS NODE TO WORK WITH DB2 ......................................................... 8


2.2 PREPARE YOUR WORKSPACE .................................................................................................... 9
2.3 REMOVE APPLICATIONS FROM TESTNODE ............................................................................ 10
2.4 SET THE QUEUE MANAGER FOR TESTNODE_IIBUSER............................................................ 11
2.5 CONFIGURE THE MQ NODES .................................................................................................. 12
2.6 ADD A MAP NODE .................................................................................................................. 15
2.7 ADD A TRACE NODE ............................................................................................................... 17

3. SCENARIO 1: USING AN IIB NODE WITH AN ASSOCIATED QUEUE MANAGER ................ 19

3.1 REVIEW THE MQ CLIENT APPLICATION .................................................................................... 19


3.2 DEPLOY AND TEST USING THE FLOW EXERCISER ..................................................................... 22
3.2.1 Verify the connection to the queue manager .................................................................. 27

4. PREPARING TO RUN MQ APPLICATIONS ON IIB NODES WITH NO ASSOCIATED QUEUE


MANAGER ............................................................................................................................................ 31

4.1 CREATE THE IIB NODES ......................................................................................................... 32

5. SCENARIO 2: IIB NODE WITH NO ASSOCIATED QUEUE MANAGER: USING AN MQ


SERVER CONNECTION ...................................................................................................................... 34

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

6. SCENARIO 3: IIB NODE WITH NO ASSOCIATED QUEUE MANAGER: USING AN MQ


CLIENT CONNECTION ........................................................................................................................ 45

6.1 CONFIGURE THE MQ NODES TO USE AN MQ CLIENT CONNECTION ............................................ 46


6.1.1 Configure the MQ Client application ............................................................................... 46
6.1.2 Configure the MQ Provider application ........................................................................... 47
6.2 TEST THE SCENARIO USING THE FLOW EXERCISER .................................................................. 48
6.3 VERIFY THE QUEUE MANAGER CONNECTION (CLIENT CONNECTION) ........................................... 51

END OF L AB GUIDE ....................................................................................................................... 53

Page 2 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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:

1) Local (server) bindings connections


2) Client connectivity through a local WebSphere MQ client installation
3) Client connectivity using a Client Connection Definition Table (CCDT).

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):

Page 3 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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 :

Page 4 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

Page 5 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

1.1 The MQ based applications


Similar to the Web Services based JSON client and EmployeeService provided in other guides
throughout this workshop, a Client and Provider application is supplied.

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.

The following sections describe these applications in more detail.

NOTE: The applications are provided purely to show (within the context of this
workshop).

1) The flexibility of MQ in IIB V10 and


2) The reuse of Maps stored in a Shared Library

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.

1.1.1 The Provider application

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.

Page 6 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

1.1.2 The Client application

The EmployeeService_JSON_MQClient contains a message flow that:

1) Accepts a JSON request from an HTTP Input node


2) Converts the JSON to the required XML format for the EmployeeMQProvider to process the
request using a mapping node. Note this node also demonstrates a new Graphical Data
mapping feature in IIB V10 where it is possible to address the IIB Environment tree in the
mapping node. The map saves the HTTP Request ID in Environment variables so that the
HTTP Reply node works correctly after removing the HTTP headers from the Message tree in
the scenario.
3) Removes the HTTP Headers
4) Writes the XML version of the request to the MQREQUEST queue
5) Waits for XML response data to appear on the MQRESPONSE queue
6) Removes the MQ headers from the Message Tree
7) Uses a second mapping node:
a. Transforms the XML provided through the MQRESPONSE queue back to JSON
b. Reinstates the data saved HTTP Request ID from the Environment Variables into the
message tree so that the HTTP reply node can work correctly.
8) Provides the Response data back to the requestor as JSON data.

Page 7 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2. Complete the Provider application

Login to Windows as the user "iibuser", password = "passw0rd".

Start the IIB Toolkit from the Start menu.

The EmployeeMQProvider application is supplied with an empty message flow.

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.

Response messages are written to the queue MQRESPONSE.

2.1 Configure Integration Bus node to work with DB2

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

2. Run the command


3_Create_JDBC_for_HRDB

Accept the defaults presented in the script. This will create the required JDBC
configurable service for the HRDB database.

3. Run the command


4_Create_HRDB_SecurityID

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.

Page 8 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2.2 Prepare your workspace


1. To avoid naming clashes with earlier labs, this lab will be developed using a new workspace.

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

2. Import the PI file


c:\student10\MQTopology\Resources\
MQTopology_startingPoint.10.0.0.3.zip

Import all projects in the PI file. Your workspace will be updated and look like this:

3. Check the Library References.

Right-click the EmployeeMQProvider application, and select Manage Library References.

The library EmployeeService_interface_and_maps should be ticked. Click OK to close.

Perform the same check on the application EmployeeService_JSON_MQClient.

Page 9 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2.3 Remove applications from TESTNODE


To avoid any conflicts with earlier scenarios, remove all deployed applications and other artefacts
from the TESTNODE_iibuser node.

In the Integration Toolkit, in the Integration Nodes pane, right-click and select Delete, All Flows and
Resources.

Page 10 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2.4 Set the Queue Manager for TESTNODE_iibuser


The TESTNODE_iibuser node was originally created automatically by IIB when the user iibuser
opened the IIB Toolkit. This node was created without an associated queue manager. In this lab, the
scenarios will be using MQ queues, so to access these queues using without specifying the name of
the queue manager, the node has to be changed to have an associated queue manager.

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.

This activity will stop and restart TESTNODE_iibuser.

Page 11 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2.5 Configure the MQ Nodes


1. In the Integration Toolkit, expand the EmployeeMQProvider application and open the
getEmployeeDetails message flow:

2. The message flow canvas has no nodes defined on it.

In the Node Palette, open WebSphere MQ and add an MQInput Node then add MQOutput
node as follows:

3. Rename the MQInput node to “Read Request”

4. Rename the MQOutput node to “Write Response”.

5. Click the MQInput node. In the Properties (Basic tab), specify a queue name MQREQUEST:

Page 12 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

Page 13 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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”)

III. On a remote queue manager (client connection properties will be required)

IV. On a remote queue manager where connection properties are defined in a Client
channel definition table (CCDT)

Leave Connection as “Local queue manager” (the default setting).

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:

Page 14 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2.6 Add a Map Node


1. Open the Transformation folder in the node Palette and drop a mapping node on to the flow
editor between the MQInput and MQOutput Nodes.

Call the Mapping node “getEmployee_XML” and connect the terminals as shown:

2. Click the Mapping node to show the node properties.

On the Basic tab, click the Browse button to specify an existing mapping routine:

Page 15 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

3. In the “Data Transformation Map Selection” window, highlight “getEmployee_XML” in the


shared library and press OK:

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.

Close the map editor.

Page 16 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2.7 Add a Trace node


1. Add a trace node after the MQOutput node and connect both the MQOutput terminals to it.
Call the trace node “MQ Provider Trace”

You will use this trace node to identify the effects of changes in the MQ Connection tab in the
Flow Exerciser tool.

2. Configure the trace node with the following properties:

• Destination: Local Error Log


• Pattern: LocalEnvironment: ${LocalEnvironment}

Page 17 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

3. Save the message flow (Ctrl-S).

It should look similar to the following when complete:

4. Leave the message flow open in the flow editor.

Page 18 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

3. Scenario 1: Using an IIB node with an associated


queue manager
In this section you will configure the applications to use queues defined on the local queue manager
that you have associated with the TESTNODE_iibuser. This is the structure that corresponds to the
use of MQ in previous versions of IIB.

The IIB/MQ topology will look like this:

3.1 Review the MQ Client Application

1. In the Integration Toolkit, expand the EmployeeService_JSON_MQClient application.

Open the JSON_MQClient message flow:

Page 19 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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).

Page 20 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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):

Page 21 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

3.2 Deploy and test using the Flow Exerciser


You will now use the Flow Exerciser to test the applications on TESTNODE_iibuser.

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.

1. Delete all flows and resources from TESTNODE_iibuser/default.

2. Return to the open getEmployeeDetails.msgflow and click the record button:

Page 22 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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:

Page 23 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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 :

Page 24 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

7. Now switch to the open message flow JSON_MQClient.msgflow and repeat the steps above
until the message flow is in record mode:

Both message flows are now ready to record activity.

8. In the JSON_MQClient.msgflow, click the “Send a message to the flow” icon:

Page 25 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

9. In the Send Message window, expand “Input Messages”.

Highlight “Employee 000010” and click Send:

10. The “Progress Information” window will open.


When the line “Received HTTP reply message for HTTP Input” appears, highlight the line to
see the data retrieved from the database:

Page 26 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

3.2.1 Verify the connection to the queue manager


1. Close the Progress Information window.

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”):

Page 27 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

2. A yellow popup window will open with the title “Recorded Message”.

Expand Environment and Local Environment.

Note the details in “DestinationData” reflect the details used by the MQOutput node:

3. Close the Recorded Message window.

4. Switch to the getEmployeeDetails.msgflow (the MQ Provider).

Click the icon to view the path the message took through this flow:

Page 28 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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:

We will revisit this area when we change the MQ Connection details.

7. Close the Recorded Message popup.

Page 29 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

The message flow will return to a white background.

10. Repeat the above step on JSON_MQClient.msgflow to return that flow to edit mode.

Page 30 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

4. Preparing to run MQ applications on IIB nodes with


no associated queue manager
MQ Flexibility in IIB V10 enables MQ Applications to run on IIB nodes which do not have a queue
manager associated with the IIB node.

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

Page 31 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

4.1 Create the IIB Nodes


In this section, you will define the IIB nodes you will use throughout the remainder of the Lab guide.

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)

• Integration node name: IB10NODE_CMQ


• Default integration server name: MQCONSUMER
• Default queue manager: <leave blank >

3. Repeat the above process and create a local Integration Node called IB10NODE_PMQ with
server MQPROVIDER.

Page 32 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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:

6. Open an Integration Console (from the Start menu) and navigate to

C:\student10\MQ_Topology\commands

7. Run the command


00ConfigureMQIIBNodes.cmd

Accept the defaults to start the script.

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.

The Integration Nodes will be restarted as part of the script.

When the script has successfully completed, the two Integration Nodes you created earlier:

1) “IB10NODE_PMQ” (with Integration Server called “MQPROVIDER”)

and

2) “IB10NODE_CMQ” (with Integration Server called “MQCONSUMER”)

should still be running (right click on the node and click refresh to update the Integration
Nodes view).

Page 33 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

5. Scenario 2: IIB node with no associated queue


manager: Using an MQ SERVER connection
5.1 Configure the MQ nodes to use a different LOCAL queue
Manager
You will now configure the MQ applications to use queues on a different queue manager (QM2). Both
the queue manager and queues have already been defined for you.

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.

The topology you will set up will look this:

Page 34 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

5.1.1 Configure the MQ Provider application


1. In the getEmployeeDetails message flow, click the MQInput node (“Read Request”) to show
the node properties.

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”:

3. Save the message flow (Ctrl-s).

Page 35 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

5.1.2 Configure the MQ Client application


You will now configure the MQ Client application to use queues (already defined) on a queue
manager (QM2) defined locally.

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:

3. Save the message flow (Ctrl-s).

Page 36 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

5.2 Test the scenario using the Flow Exerciser


You will now test the applications and verify that the queue being used is defined on QM2.

1. Return to the open getEmployeeDetails.msgflow and start the Flow Exerciser:

2. When prompted where to deploy the application, chose MQPROVIDER on


IB10NODE_PMQ and click Finish:

Page 37 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

3. If the message appears, dismiss the “Ready to record message”:

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:

5. Switch to the open message flow JSON_MQClient.msgflow.

Start the flow Exerciser.

Page 38 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

6. When prompted where to deploy the message flow, select MQCONSUMER on


IB10NODE_CMQ:

7. If the “Ready to record message” appears, dismiss 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:

9. In the JSON_MQClient.msgflow, click the “Send a message to the flow”:

Page 39 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

Highlight the line to see the received data.

You will see the response from the database look up using the key “000010”:

Page 40 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

5.3 Verify the connection to the queue manager (server


connection)
You will now use the Flow Exerciser to verify that the queue being used is defined on QM2.

1. Close the Progress Information window.

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”:

Page 41 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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 SERVER
(Bindings) connection to QM2.

3. Switch to the getEmployeeDetails message flow and click the “Show message path
through the message flow” button:

Page 42 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

Page 43 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

8. Stop the Flow Exerciser recording messages in the JSON_MQClient.msgflow:

9. Stop the Flow Exerciser recording messages in getEmployeeDetails.msgflow

Page 44 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

6. Scenario 3: IIB node with no associated queue


manager: Using an MQ CLIENT connection
You will now configure the MQ applications to access the queues on queue manager (QM2) using a
Client Connection.

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):

Page 45 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

6.1 Configure the MQ nodes to use an MQ client connection


6.1.1 Configure the MQ Client application
1. In the JSON_MQClient message flow, click the MQOutput node (“Submit Request”) to show
the node properties in the properties tab.

Specify the following connections properties for the node:

• Connection* : MQ client connection properties


• Destination queue manager name : QM2
• Queue manager host name : localhost
• Listener port number : 1442
• Channel name : TOQM2

2. Repeat the above step for the MQGet node called “Process Response”.

The properties tab should look like this (the same as above):

3. Save the message flow (ctrl s)

Page 46 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

6.1.2 Configure the MQ Provider application


1. In the getEmployeeDetails message flow, click the “Read Request” MQInput node to show
the nodes properties in the properties tab.

Specify the following client connection properties in the MQ Connection tab:

2. Click the MQOutput node “Write Response” and configure the MQ Connection properties as
above:

3. Save the message flow (ctrl s)

Page 47 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

6.2 Test the scenario using the Flow Exerciser


You will now test the applications and verify the connection the type of connection to the queue
manager QM2.

1. In the getEmployeeDetails.msgflow, click the Flow Exerciser button:

2. If prompted, deploy to MQPROVIDER on IB10NODE_PMQ:

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:

4. Now switch to the message flow JSON_MQClient.msgflow.

Click the record button.

Deploy the updated application to MQCONSUMER on IB10NODE_CMQ.

Page 48 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

5. If the “Ready to record message” appears, dismiss it.

6. In the JSON_MQClient.msgflow, click the “Send a message to the flow”:

7. In the Send Message window, expand Input Messages and highlight “User 000010” and click
Send:

Page 49 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

8. The “Progress Information” window will open.

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”:

Page 50 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

6.3 Verify the queue manager connection (client connection)


You will now use the Flow Exerciser to verify that the connection details used by the runtime
environment.

1. Close the Progress Information window.

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”:

Page 51 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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:

Page 52 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks
IBM Integration Bus V10 Workshop January 2016

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.

END OF LAB GUIDE

Page 53 of 53 Flexible MQ Topologies: Version 10.0.0.3


Configuring MQ Nodes using MQ Connection Properties
Provided by IBM BetaWorks

You might also like