mq92 Scenarios
mq92 Scenarios
IBM MQ Scenarios
IBM
Note
Before using this information and the product it supports, read the information in “Notices” on page
201.
This edition applies to version 9 release 2 of IBM® MQ and to all subsequent releases and modifications until otherwise
indicated in new editions.
When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it
believes appropriate without incurring any obligation to you.
© Copyright International Business Machines Corporation 2007, 2024.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
Scenarios.............................................................................................................. 5
Getting started with IBM MQ....................................................................................................................... 5
Planning the solution..............................................................................................................................5
Implementing the solution.....................................................................................................................7
What to do next.................................................................................................................................... 18
Point-to-point scenario..............................................................................................................................18
Planning the solution............................................................................................................................18
Implementing the solution...................................................................................................................20
Securing the point-to-point topology.................................................................................................. 26
Streaming queues...................................................................................................................................... 29
Streaming queues configuration..........................................................................................................30
Streaming to remote and alias queues................................................................................................ 31
Streaming queue restrictions...............................................................................................................32
Stream queues and transactions......................................................................................................... 33
Streaming to and from cluster queues................................................................................................ 33
Publish/subscribe scenarios..................................................................................................................... 34
Publish/subscribe cluster scenario......................................................................................................34
Publish/subscribe hierarchy scenarios................................................................................................40
Transactional support scenarios............................................................................................................... 49
Introducing units of work..................................................................................................................... 50
Scenario 1: Queue manager performs the coordination..................................................................... 51
Scenario 2: Other software provides the coordination....................................................................... 75
Expiring global units of work................................................................................................................82
Unit of recovery disposition................................................................................................................. 82
Security scenarios......................................................................................................................................83
Security scenario: two queue managers on z/OS................................................................................83
Security scenario: queue sharing group on z/OS.................................................................................91
Server-to-server message channel interception example configurations......................................... 96
Connecting two queue managers using SSL/TLS................................................................................ 97
Connecting a client to a queue manager securely............................................................................ 104
Migrating on Windows............................................................................................................................. 110
Planning the solution......................................................................................................................... 110
Implementing the solution using the graphical user interface.........................................................115
Installing a later version of IBM MQ to coexist with an earlier version on Windows.............................139
Overview of multiple installations..................................................................................................... 139
Installing a later version of IBM MQ side-by-side to an earlier version........................................... 140
Using the setmqenv command to run with both versions of IBM MQ.............................................142
Creating a queue manager.................................................................................................................144
Migrating a queue manager to a later version of IBM MQ ................................................................145
Installing a fix pack on IBM MQ 9.2...................................................................................................147
Managed File Transfer scenario.............................................................................................................. 149
MFT common topologies....................................................................................................................149
Configuring the base server............................................................................................................... 152
Getting started with IBM MQ Internet Pass-Thru...................................................................................160
Verifying that MQIPT is working correctly......................................................................................... 161
Creating a key ring file........................................................................................................................163
Creating test certificates....................................................................................................................165
Authenticating a TLS server............................................................................................................... 167
Authenticating a TLS client................................................................................................................ 169
Configuring HTTP tunneling............................................................................................................... 171
Configuring access control.................................................................................................................173
Configuring a SOCKS proxy................................................................................................................ 175
iii
Configuring a SOCKS client................................................................................................................ 177
Configuring MQIPT clustering support.............................................................................................. 178
Allocating port numbers.................................................................................................................... 181
Retrieving CRLs by using an LDAP server.......................................................................................... 182
Running MQIPT in TLS proxy mode................................................................................................... 185
Running MQIPT in TLS proxy mode with a security manager........................................................... 187
Using a security exit........................................................................................................................... 189
Routing client connection requests to IBM MQ queue manager servers by using security exits....191
Dynamically routing client connection requests............................................................................... 194
Using a certificate exit to authenticate a TLS server.........................................................................197
Notices..............................................................................................................201
Programming interface information........................................................................................................ 202
Trademarks.............................................................................................................................................. 202
iv
IBM MQ Scenarios
Each scenario walks you through a significant set of tasks, and helps you to configure a major product
feature. The scenarios include useful links to other content to help you to gain a better understanding of
the area in which you are interested.
The available IBM MQ scenarios are described in the following subtopics. The IBM Product Connectivity
Scenarios and Patterns product documentation provides worked examples of using several IBM products
(for example, IBM MQ and WebSphere® Application Server ) connected together.
Related information
IBM Product Connectivity Scenarios and Patterns information
Basic concepts
IBM MQ enables applications to read and write messages to a queue. The application that reads the
message is independent of the application that writes the message. It is not a requirement to have the
two applications running at the same time. If no application is available to read the message it is queued
on the IBM MQ queue until an application reads it.
In this scenario you can choose to install and configure IBM MQ in one of the following ways:
“Installing and configuring using the graphical user interface” on page 7
During installation using the graphical user interface, you are guided through several screens and
wizards to help you apply the relevant options and settings:
Launchpad
Check software requirements, specify network information and start the IBM MQ installation
wizard.
IBM MQ installation wizard
Install the software and start the Prepare IBM MQ Wizard.
Prepare IBM MQ Wizard
Start the IBM MQ service and IBM MQ Explorer.
IBM MQ Explorer
Manage queues and queue managers.
“Installing and configuring using the command line interface” on page 11
The command line interface installation can be silent or interactive. The silent installation is fully
accessible and is the one covered in this scenario. During installation using the command line, you are
guided through several steps to help you apply relevant options and settings:
• Install IBM MQ
• Create and configure IBM MQ objects; queue managers and queues.
• Verify the installation by using amqsput to put and amqsget to get a message from the queue.
As well as using IBM MQ Explorer and command line to create IBM MQ objects, it is possible to do so by
using the programmable interface. This is not included in the current scenario.
Key terms
Here is a list of key terms about message queuing.
Key terms about message queuing.
Term Description
Queue The queue manager is responsible for maintaining the queues it owns, and for storing all
managers the messages it receives onto the appropriate queues.
Messages A message is a string of bytes that is meaningful to the applications that use it.
Messages are used to transfer information from one application program to another.
The applications can be running on the same or on different computers.
Local queues A local queue is a data structure used to store messages. The queue can be a normal
queue or a transmission queue. A normal queue holds messages that are to be read
by an application that is reading the message directly from the queue manager. A
transmission queue holds messages that are in transit to another queue manager.
6 IBM MQ Scenarios
Implementing the solution
Implement the solution to the scenario. Install IBM MQ on Windows using the installation Launchpad,
then verify the installation using the IBM MQ Explorer.
Procedure
1. Start the Launchpad, review, and if necessary, modify the software requirements and network
configuration.
a) Navigate to the IBM MQ software directory, and double-click the file Setup.exe to start the
Launchpad.
b) Select the Software Requirements tab to display the Software Requirements settings.
c) Check that the software requirements have been met and that the entry for the requirement
displays a green tick with the words OK. Make any indicated corrections.
Note:
IBM MQ Scenarios 7
For details of any requirement, click the check box to expand an information tab.
d) Select the Network Configuration tab to display the Network Configuration settings.
e) Select No.
Note: This scenario assumes that you do not need to configure a domain user ID for IBM
MQ. For more information regarding configuring IBM MQ for Windows domain users, click More
information.
f) On the IBM MQ Installation tab of the Launchpad, select the installation language, and then click
Launch IBM MQ Installer to start the IBM MQ installation wizard.
You have completed setting up IBM MQ by meeting or specifying your installation requirements, and
have started the IBM MQ installation wizard.
2. Use the IBM MQ installation wizard to install the software, and to start the Prepare IBM MQ Wizard.
a) In the IBM MQ installation wizard, read the License Agreement and click the I accept the terms in
the license agreement check box, and then click Next.
b) Click Typical, and then click Next.
c) In the Ready to Install IBM MQ page, review the installation information and click Install.
Note: Note the following details:
• Installation Name
• Top-level folder for Program Files
• Top level folder for Data Files
The following features are installed:
• IBM MQ Server
• IBM MQ: a graphical interface for administering and monitoring IBM MQ resources
• Java and .NET Messaging and Web Services
• IBM MQ Development Toolkit
The installation process begins. Depending on your system the installation process can take several
minutes.
At the end of the installation process, the IBM MQ Setup window displays the message
Installation Wizard Completed Successfully .
d) Click Finish.
You have successfully installed IBM MQ. The Prepare IBM MQ Wizard starts automatically, displaying
the Prepare IBM MQ Wizard page.
3. Use the Prepare IBM MQ Wizard to start the IBM MQ service.
a) On the Welcome to the Prepare IBM MQ Wizard page, select Next.
The Prepare IBM MQ Wizard displays the message Status: Checking IBM MQ
Configuration and a progress bar. When the process is complete the IBM MQ Network
Configuration page is displayed.
b) On the IBM MQ Network Configuration page of the Prepare IBM MQ Wizard, select No.
c) Click Next.
The Prepare IBM MQ Wizard displays a message Status: starting the IBM MQ Service ,
and a progress bar. When the process is complete the wizard displays the Completing the Prepare
IBM MQ Wizard page.
d) Select Launch IBM MQ Explorer and choose whether to view the release notes, then click the
Finish button.
IBM MQ Explorer starts.
You have installed IBM MQ. You have also started the IBM MQ Explorer.
8 IBM MQ Scenarios
Results
IBM MQ is installed and verified, and you are ready to configure objects such as queue managers and
queues.
What to do next
Follow the instructions in “Creating a queue manager called QM1” on page 9.
Related concepts
Introduction to IBM MQ
Related tasks
Installing an IBM MQ server on Windows
Configuring an IBM MQ server
Related reference
Disc space requirements
Hardware and software requirements on Windows systems
Procedure
1. Start IBM MQ Explorer as an administrator.
2. In the Navigator view, right-click the Queue Managers folder, then click New > Queue Manager. The
Create Queue Manager wizard starts.
3. In the Queue Manager name field, type QM1.
4. Select the Make this the default queue manager check box.
5. In the Dead-letter queue field type SYSTEM.DEAD.LETTER.QUEUE.
This is the name of the dead-letter queue that is automatically created when you create the queue
manager.
6. Leave the other fields empty and click Finish, or if that button is disabled, click Next.
The Finish button is disabled if the port number conflicts with an existing queue manager, for example
the queue manager that is created as part of the default configuration. You must continue through the
wizard to change the default port number.
7. If you clicked Next, continue to accept the defaults and click Next on each page until you get to the
final page of the wizard, when the Finish button becomes available. Change the specified port number,
for example to 1415, and click Finish.
IBM MQ displays a Creating Queue Manager dialog window while the queue manager is created and
started.
What to do next
To create a queue, see “Creating a queue called LQ1” on page 10.
IBM MQ Scenarios 9
Related tasks
Creating and managing queue managers on Multiplatforms
Procedure
1. In the Navigator view, expand the Queue Managers folder.
2. Expand queue manager QM1.
3. Right-click the Queues folder, then click New > Local Queue... The New Local Queue wizard starts.
4. In the Name field, type LQ1.
5. Click Finish.
The new queue LQ1, is displayed in the Content view. If the queue is not displayed in the Content
view, click on the Refresh button, at the top of the Content view.
What to do next
You are ready to put a message on to your queue. To put a message in a queue, see “Putting a message to
the queue LQ1” on page 10.
Procedure
1. In the Navigator view, expand the Queue Managers folder.
2. Expand queue manager QM1, which you created.
3. Click the Queues folder. The queue manager's queues are listed in the Content view.
4. In the Content view, right-click the local queue LQ1, then click Put Test Message...
The Put test message dialog opens.
5. In the Message data field, type some text, for example Hello World, then click Put message.
The Message data field is cleared and the message is put on the queue.
6. Click Close.
In the Content view, notice that the LQ1 Current queue depth value is now 1. If the Current queue
depth column is not visible, you might need to scroll to the right of the Content View.
What to do next
To get a message from the queue, see “Getting a message from the queue LQ1” on page 11.
10 IBM MQ Scenarios
Getting a message from the queue LQ1
Get a message from the queue LQ1 by using IBM MQ Explorer.
Procedure
1. In the Navigator view, expand the Queue Managers folder, then expand QM1.
2. Click the Queues folder.
3. In the Content view, right-click the local queue LQ1, then click Browse Messages.... The Message
browser opens to show the list of the messages that are currently on QM1.
4. Double-click the last message to open the properties dialog.
On the Data page of the properties dialog, the Message data field displays the content of the message
in human-readable form.
What to do next
Follow the instructions in subsequent scenarios to explore further IBM MQ features.
To learn about writing queuing applications, connecting to and disconnecting from a queue manager,
publish/subscribe, and opening and closing objects, see Writing a procedural application for queuing.
IBM MQ Scenarios 11
Note: If you have any previous installations of IBM MQ on your machine the default locations of the
program and data files might change. For further information, see Program and data directory locations. If
you have already previously completed this scenario, and want to repeat it with a single, fresh installation
using the default locations, remove your previous installation before starting the scenario again. To
uninstall an existing instance of IBM MQ from your machine, see “Uninstalling IBM MQ” on page 17.
IBM MQ on Windows uses the MSI technology to install software. For more information on installing using
the MSI technology, see Advanced installation using msiexec.
To install IBM MQ using the command line, you must specify the following parameters:
• /i "MQ_INSTALLATION_MEDIA\MSI\IBM MQ.msi" where MQ_INSTALLATION_MEDIA is the location
of the IBM MQ.msi file. This argument specifies the location of the .msi file.
• /l*v USER_LOGFILE_LOCATION\install.log where USER_LOGFILE_LOCATION is where you want
the installation logs to be written to.
Note: The folder where you want the install.log to be created must exist before you run the
command.
• /q[n|b|r|f] /q must be paired with one of n, b, r, or f. Running the msiexec command at a
command prompt opens the help file, which shows the correct usage.
• USEINI="RESPONSE_FILE" where RESPONSE_FILE is the name and location of the response file to be
used by the silent installation. This scenario uses the sample Response.ini file, which is included in
the IBM MQ installation media.
• TRANSFORMS="TRANSFORM_FILE" where TRANSFORM_FILE is the name of the transform file to be
applied to the installation. This scenario uses the American English transform, 1033.mst.
• AGREETOLICENSE="YES" this parameter must be included, or the installation can not complete.
• ADDLOCAL="Server" this parameter lists which components to install.
Procedure
1. Use the command line to conduct a silent installation.
a) To invoke the silent installation from an elevated command prompt, click the Start button on
your Windows taskbar and type cmd in search programs and files field. Right click the cmd.exe
program and select Run as administrator.
b) In the Windows command prompt, enter the following command:
Note: The command is presented on multiple lines here, but it must be typed out on one line.
12 IBM MQ Scenarios
a) Enter the following command in the command line:
"MQ_INSTALLATION_PATH/bin/setmqenv" -s
where MQ_INSTALLATION_PATH refers to the location where IBM MQ is installed. Ensure you
enclose the path to setmqenv in the bin folder, in quotation marks, to prevent the prompt
returning an error.
Note: If you used the default location, the path to your installation will be C:\Program
Files\IBM\MQ.
b) Check that the environment is set up correctly by entering the following command:
dspmqver
If the command completes successfully, and the expected version number and installation name
are returned, the environment is correctly set up. The message should include the line:
Version: n.n.n.n
where n.n.n.n is the version number and, if you did not specify a non-default installation name,
the line:
InstName: Installation1
Results
You have conducted an IBM MQ silent installation and confirmed that your environment is set up
correctly.
What to do next
• You can run the Prepare IBM MQ Wizard.
• Follow the instructions in “Creating a queue manager called QM1” on page 13.
If you encounter any issues during the installation, check the installation log, at the location
that you specified in the msiexec command, in this scenario the location of the log file is:
c:\wmqinslogs\install.log. Take any action that is specified in the log and rerun the installation
again. You can also check the parameters that you passed with the command, masking sure you are
including all the required parameters.
Related concepts
Advanced installation using msiexec
Related tasks
Using transforms with msiexec
Installing IBM MQ - overview
IBM MQ Scenarios 13
About this task
In this example, all names are typed in uppercase and because IBM MQ names are case-sensitive, you
must type all names in uppercase too.
Procedure
1. Open a command prompt as an administrator.
2. Create a queue manager with the name QM1 by typing the following command:
crtmqm QM1
When the system creates the queue manager, the following output is displayed:
C:\>crtmqm QM1
IBM MQ queue manager created.
Creating or replacing default objects for QM1.
Default objects statistics : 61 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
The queue manager is created, and is stopped. You must start the queue manager before you can
administer it, and before you can read and write messages from its queues.
3. Start the queue manager by entering the following command:
strmqm QM1
When the queue manager successfully starts, the following output is displayed:
C:\>strmqm QM1
IBM MQ queue manager 'QM1' starting.
5 log records accessed on queue manager 'QM1' during the log replay phase.
Log replay for queue manager 'QM1' complete.
Transaction manager state recovered for queue manager 'QM1'.
IBM MQ queue manager 'QM1' started.
What to do next
To create a queue, see “Creating a queue called LQ1” on page 14.
Related tasks
Creating and managing queue managers on Multiplatforms
14 IBM MQ Scenarios
The command-line interface has a scripting language called IBM MQ Script Commands (MQSC). The
scripting tool, runmqsc, is used to run the script against a queue manager. To create and start a queue by
using the command-line interface, complete the following steps.
Procedure
1. Start the scripting tool by typing the following command:
runmqsc QM1
C:\>runmqsc QM1
5724-H72 (C) Copyright IBM Corp. 1994, 2024. ALL RIGHTS RESERVED.
Starting MQSC for queue manager QM1.
define qlocal(LQ1)
define qlocal(LQ1)
2 : define qlocal(LQ1)
AMQ8006: IBM MQ queue created.
end
C:\>
What to do next
You are ready to put a message on to your queue. To put a message in a queue, see “Putting a message to
the queue LQ1” on page 15.
To put a message to the queue by using the command-line interface, complete the following steps.
Procedure
1. Use the amqsput sample application to put a message to queue LQ1, by typing the following
command:
IBM MQ Scenarios 15
amqsput LQ1 QM1
2. Type Hello World and press Enter. You placed a message that contains the text "Hello World" on the
queue LQ1 managed by the queue manager called QM1.
3. To end amqsput, press Enter. The following output is displayed:
What to do next
To get a message from the queue, see “Getting a message from the queue LQ1” on page 16.
Procedure
Use the amqsget sample application to read a message on the queue LQ1, by typing the following
command:
What to do next
Follow the instructions in subsequent scenarios to explore further IBM MQ features.
To learn about writing queuing applications, connecting to and disconnecting from a queue manager,
publish/subscribe, and opening and closing objects, see Writing a procedural application for queuing.
16 IBM MQ Scenarios
Uninstalling IBM MQ
Stop, and then uninstall IBM MQ, including removing any queue managers and their objects. At the end of
this task, you are ready to reinstall IBM MQ.
Procedure
1. Stop the IBM MQ service.
a) Right-click on the IBM MQ icon in the system tray, then click Stop IBM MQ to stop the IBM MQ
service.
A dialog with the following message is displayed:
Shutting down IBM MQ installation "Installation1" terminates all running queue managers and
IBM MQ processes for that installation, except those under Microsoft Failover Cluster
control.
Are you sure you want to continue?
b) Click Yes and then wait for the IBM MQ to stop.
c) When the IBM MQ stops, right-click the IBM MQ icon in the system tray, then click Exit
2. Begin the uninstalling process in one of the two following ways:
a) In Windows Explorer, navigate to the temporary folder with the installation image and double click
setup.exe.
b) Insert the IBM MQ for Windows Server DVD into the DVD drive. If autorun is enabled, the
installation process starts. Otherwise, double-click the Setup icon in the root folder of the DVD
to start the uninstalling process.
The IBM MQ Installation Launchpad window opens.
3. Remove IBM MQ.
a) Click IBM MQ Installation.
b) Click Launch IBM MQ Installer and click Next until the IBM MQ Program Maintenance pane is
displayed with a welcome message.
If this pane is not displayed, IBM MQ for Windows is not currently installed.
c) Click Maintain or upgrade an existing instance. Select Installation1 to remove it. Click Next and
in the Program Maintenance pane, click Remove, then Next.
The Removing Server feature pane is shown.
d) Select Remove: remove existing queue managers and their objects.
Click Next.
The Remove IBM MQ pane is displayed, with a summary of the installation to be removed.
e) Click Remove to continue.
If a message appears stating that locked files are found, ensure that no IBM MQ programs are
running; see Uninstalling IBM MQ on Windows systems.
When IBM MQ is uninstalled, a message indicates completion.
f) Click Finish.
IBM MQ Scenarios 17
You have successfully uninstalled IBM MQ.
Related tasks
Uninstalling IBM MQ on Windows systems
What to do next
What to do next on completion of the Getting started with IBM MQ scenario.
Point-to-point scenario
Connect two IBM MQ queue managers in a point-to-point topology to enable distributed queuing.
18 IBM MQ Scenarios
Overview: The delivered logical topology
The delivered logical topology after completing the scenario.
The point-to-point infrastructure allows one directional messaging between queue managers on different
host machines. Queue manager one, on host one sends messages to queue manager two, on host two.
After this scenario is complete, the delivered topology will look like Figure 1.
Basic concepts
IBM MQ enables applications to read and write messages to a queue. The application that reads the
message is independent of the application that writes the message. It is not a requirement to have the
two applications running at the same time. If no application is available to read the message it is queued
on the IBM MQ queue until an application reads it.
Key terms
Here is a list of key terms about message queuing.
IBM MQ Scenarios 19
Key terms about message queuing.
Term Description
Queue The queue manager is responsible for maintaining the queues it owns, and for storing
managers all the messages it receives onto the appropriate queues.
Messages A message is a string of bytes that is meaningful to the applications that use it.
Messages are used to transfer information from one application program to another.
The applications can be running on the same or on different computers.
Local queues A local queue is a data structure used to store messages. The queue can be a normal
queue or a transmission queue. A normal queue holds messages that are to be read
by an application that is reading the message directly from the queue manager. A
transmission queue holds messages that are in transit to another queue manager.
Remote queues A remote queue is used to address a message to another queue manager.
Channels Channels are use to send and receive messages between queue managers.
Listeners Listeners are processes that accept network requests from other queue managers, or
client applications, and start associated channels.
20 IBM MQ Scenarios
Creating the queue manager
Create an IBM MQ queue manager to send messages to the target queue manager.
Procedure
1. Create a queue manager with the name QM1. On the command-line, type:
crtmqm QM1
The following messages are displayed to confirm that the queue manager is created:
strmqm QM1
The following messages are displayed to confirm that the queue manager is started:
Results
The IBM MQ queue manager QM1 is created and started.
What to do next
To create the queues to use with QM1, follow the instructions in “Creating the queues” on page 21.
IBM MQ Scenarios 21
Procedure
1. On the command-line, type:
runmqsc QM1
What to do next
To create the sender channel that is used to connect to the target queue manager, follow the instructions
in “Creating the sender channel” on page 22.
Procedure
1. On the command-line, type:
runmqsc QM1
Note: The variable remoteHost is the host name or IP address of the target queue manager.
The sender channel is created.
22 IBM MQ Scenarios
What to do next
To create the distributed queue manager topology, follow the instructions in “Creating the distributed
queue manager topology” on page 23.
Procedure
1. Create a queue manager with the name QM2. On the command-line, type:
crtmqm QM2
strmqm QM2
The following messages are displayed to confirm that the queue manager is started:
IBM MQ Scenarios 23
Results
The IBM MQ queue manager QM2 is created and started.
What to do next
To create the queue to use with QM2, follow the instructions in “Creating the queue” on page 24.
Procedure
1. Start the scripting tool by typing the following command:
runmqsc QM2
Note: Port 1414 is the default port for IBM MQ. If you chose a different port number, you must add it to
the CONNAME of the sender channel on the sending queue manager.
4. Start the listener so it is ready to accept inbound connections. In the MQSC interface, type:
START LISTENER(LISTENER1)
Note: Since the listener was created with the option CONTROL(QMGR), next time the queue manager is
started, the listener will also be automatically started.
5. Type end to exit the MQSC interface.
What to do next
To create the receiver channel to create the connection between the source and target queue managers,
follow the instructions in “Creating the receiver channel” on page 24.
24 IBM MQ Scenarios
About this task
Use the MQSC interface to create a receiver channel that is managed by QM2.
Procedure
1. On the command-line, type:
runmqsc QM2
What to do next
To start the sender channel on the source queue manager, that in turn initiates the receiver channel on the
target queue manager, ollow the instructions in “Starting the sender channel” on page 25.
Procedure
1. On the command-line, type:
runmqsc QM1
START CHANNEL(TO.QM2)
The sender channel starts, the receiver channel on the target queue manager is also started.
3. Check that the channel is running. In the MQSC interface, type:
DISPLAY CHSTATUS(TO.QM2)
If the channel is running, you will see that it reports STATUS(RUNNING). If it reports any other value in
STATUS then check the error log.
What to do next
To verify that the source queue manager can send messages to the target queue manager, follow the
instructions in “Verifying the solution” on page 26.
IBM MQ Scenarios 25
Verifying the solution
Verify that the source queue manager can put a message onto the remote queue. Verify that the target
queue manager can get the message from the queue.
Procedure
1. Send a message to the target queue manager, QM2 from the source queue manager.
a) In the command-line interface, type:
You must use the name of the remote queue definition to send the message to the target queue
manager.
The following message is displayed:
Results
The target queue manager received the message from the source queue manager, verifying that point to
point communication is achieved.
What to do next
If you want to add security to the solution, follow the instructions in “Securing the point-to-point
topology” on page 26.
26 IBM MQ Scenarios
Securing the source queue manager objects
Set the authorization values for the objects on the source queue manager.
Procedure
1. To grant the specified user group with connect authorization to the queue manager, on the command-
line interface, type:
2. To grant the specified user group with put authorization on the remote queue definition, on the
command-line interface, type:
Procedure
1. To grant the specified user group with connect authorization to the queue manager, on the command-
line interface, type:
2. To grant the specified user group with get authorization on the remote queue definition, in the
command-line interface, type:
IBM MQ Scenarios 27
About this task
Create the IBM MQ queue manager's key repository, import the certificate authority's signer certificate
and create the queue manager's personal certificate request.
Procedure
1. Create a CMS key repository file for the queue manager called key.kdb. Navigate to the
Qmgrs\QM1\ssl directory, and on the command line, type:
runmqckm -keydb -create -db key.kdb -pw passw0rd -type cms -stash
Note: For this simple example we have used a password of passw0rd. You may wish to choose a
different password and change each of the following commands to use your own password instead.
2. Add the CA certificate, which you have in a file, to the key repository, on the command line, type:
runmqckm -cert -add -file CA-certificate-file -db key.kdb -pw passw0rd -label TrustedCA
3. Request a personal certificate that will be written to a request file called QM1req.req.
On the command line, enter:
The default certificate label name is shown in this example. You can set your own name if you prefer.
For details, see Digital certificate labels.
4. Send the certificate request file to your CA, they will issue a digitally signed certificate. Put the
received, signed certificate file in a suitable location to be received into the queue manager's key
repository.
5. Receive the signed personal certificate into the queue manager's key repository.
runmqckm -cert -receive -file Signed-certificate-file -db key.kdb -pw passw0rd -format ascii
6. Complete these steps for each queue manager, changing the queue manager name accordingly.
What to do next
To enable secure communication over the sender and receiver channels, follow the instructions in
“Creating the channels to use TLS” on page 28.
Procedure
1. On the command-line, type:
28 IBM MQ Scenarios
runmqsc QM1
2. Create the sender channel on QM1, called TO.QM2, in the MQSC interface, type:
Note: The variable remoteHost is the host name or IP address of the target queue manager.
You can specify a CERTLABL attribute for the channel. If you do, it must match the value on the
-label parameter of the runmqckm command that you previously ran in step 3 of “Preparing the
queue managers to use TLS” on page 27. For more information on certificate labels, see Digital
certificate labels, understanding the requirements.
3. Type end to exit the MQSC interface.
4. On the command-line, type:
runmqsc QM2
5. Create a receiver channel on QM2, called TO.QM2, in the MQSC interface, type:
What to do next
To verify that the source queue manager can send messages to the target queue manager using TLS,
follow the instructions in “Verifying the solution” on page 26.
Streaming queues
The streaming queues feature of IBM MQ allows you to configure a queue to put a near-identical copy of
every message to a second queue.
Streaming queues can be useful in certain scenarios, where you need to create a copy of your messages.
For example:
• Streaming messages to Apache Kafka using the Kafka Connect source connector for IBM MQ. For more
information, see kafka_connect_mq_source.
• Performing analysis on the data going through the system.
• Storing messages for recovery at a later time.
• Capturing a set of messages to use in development and test systems.
• Consuming IBM MQ event messages from the system event queues, and sending additional copies to
other queues or topics.
In all of these scenarios, you can configure streaming queues to ensure that the original messages remain
unaffected by the streaming process. This ensures that core business applications do not observe any
impact from the streaming.
The following illustration depicts this:
IBM MQ Scenarios 29
Related concepts
Streaming queues security
Streaming queues and AMS
30 IBM MQ Scenarios
Must duplicate
In this mode, the queue manager ensures that both the original message and the streamed message
are successfully delivered to their queues.
If, for some reason, the streamed message cannot be delivered to its queue, for example, because
the second queue is full, then the original message is not delivered to its queue either. The putting
application receives an error reason code and must try to put the message again.
See How you configure streaming queues for information on the additional attributes added to local and
model queues enabling message streaming.
Streamed messages
In most cases, the copy of the message delivered to the second queue is a duplicate of the original
message. This includes all of the message descriptor fields, including the message ID and correlation ID.
The streamed messages are intended to be very close copies of the original messages, so that they are
easier to find and, if necessary, replay them back into another IBM MQ system.
There are some message descriptor fields that are not retained on the streamed message. The following
changes are made to the streamed message before it is placed on the second queue:
• The expiry of the streamed message is set to MQEI_UNLIMITED, regardless of the expiry of the original
message. If CAPEXPRY has been configured on the secondary queue this value is applied to the
streamed message.
• If any of the following report options are set on the original message, they are not enabled on the
streamed message. This is to ensure that no unexpected report messages are delivered to applications
that are not designed to receive them:
– Activity reports
– Expiration reports
– Exception reports
– Confirmation on arrival (COA)
– Confirmation on delivery (COD)
Due to the near-identical nature of the streamed messages, most of the attributes of the secondary queue
have no affect on the message descriptor fields of the streamed message. For example, the DEFPSIST and
DEFPRTY attributes of the secondary queue have no affect on the streamed message.
The following exceptions apply to the streamed message:
• CAPEXPRY attribute
If the secondary queue has been configured with a CAPEXPRY attribute, this expiry cap is applied to the
expiry of the streamed message.
• DEFBIND for cluster queues
If the secondary queue is a cluster queue, the streamed message is put using the bind option set in the
DEFBIND attribute of the secondary queue.
IBM MQ Scenarios 31
Streaming to alias queues
By streaming messages to an alias queue, it is possible to send the duplicate messages to the target of
the alias queue. Since the target of an alias queue can also be a topic, it is therefore possible to send the
duplicate messages to a publish/subscribe topic. Any subscribers to the alias topic will receive a copy of
the duplicate message. In this way, you can create multiple copies of the original message. However, the
existing rules for publish/subscribe message are applied to the duplicated message. This means that the
messages that are sent to subscribers will not be identical to the original message, including:
• Having a new message ID.
• Having a generated correlation ID, depending on the configuration of the subscription.
• The UserIdentifier field being set to the user the queue manager is running as, not the user who put the
message.
• The PutApplName showing the name of the queue manager, not the name of the putting application.
Notes:
1. It is not possible to configure the STREAMQ attribute on remote queues or alias queues themselves.
You can only stream messages to them, not from them.
2. If messages are being streamed to a queue alias, the target of the queue alias cannot have its
STREAMQ attribute set.
32 IBM MQ Scenarios
– SYSTEM.ADMIN.CONFIG.EVENT
– SYSTEM.ADMIN.LOGGER.EVENT
– SYSTEM.ADMIN.PERFM.EVENT
– SYSTEM.ADMIN.PUBSUB.EVENT
– SYSTEM.ADMIN.QMGR.EVENT
– SYSTEM.ADMIN.STATISTICS.QUEUE
– SYSTEM.DEFAULT.MODEL.QUEUE
– SYSTEM.JMS.TEMPQ.MODEL
• Setting STREAMQ to the name of a model queue
IBM MQ Scenarios 33
Streaming from a cluster queue
This can be useful if you already send messages to several instances of a cluster queue, and would like a
copy of each message to be delivered to a streaming queue, on the same queue manager, as the cluster
queue instance.
When the original message is delivered to one of the cluster queue instances, a duplicate message is
delivered to the stream queue by the cluster-receiver channel.
Publish/subscribe scenarios
Two sets of scenarios that demonstrate use of publish/subscribe clusters and publish/subscribe
hierarchies.
The available publish/subscribe scenarios are described in the following subtopics:
.
This cluster consists of three queue managers, two of which are defined as full repository queue
managers.
You then define a cluster topic on queue manager PS3. By creating the cluster topic, you have made the
cluster into a publish/subscribe cluster. To test the publish/subscribe cluster, you subscribe to the topic
34 IBM MQ Scenarios
on any queue manager, then publish a message to the topic from another queue manager and check that
your subscription receives the message.
Related tasks
Designing publish/subscribe clusters
Configuring a queue manager cluster
Procedure
1. Create and start queue manager PS1.
a) Create the queue manager.
In the command line, enter the following command:
crtmqm PS1
strmqm PS1
What to do next
You are now ready to configure the first queue manager.
Procedure
1. Define and start a listener for PS1.
a) Launch the MQSC interface.
In the command line, enter the following command:
runmqsc PS1
b) Define a listener.
Enter the following MQSC command:
IBM MQ Scenarios 35
Enter the following MQSC command:
START LISTENER(PS1_LS)
3. Define a receiver channel for PS1, to allow other queue managers in the cluster to communicate with
it.
Enter the following MQSC command:
4. Define a sender channel from PS1 to PS2, to allow the two full repositories to exchange information.
Enter the following MQSC command:
What to do next
You are now ready to configure the second queue manager.
Procedure
1. Define and start a listener for PS2.
a) Launch the MQSC interface.
In the command line, enter the following command:
runmqsc PS2
b) Define a listener.
Enter the following MQSC command:
36 IBM MQ Scenarios
START LISTENER(PS2_LS)
3. Define a receiver channel for PS2, to allow other queue managers in the cluster to communicate with
it.
Enter the following MQSC command:
4. Define a sender channel from PS2 to PS1, to allow the two full repositories to exchange information.
Enter the following MQSC command:
What to do next
You are now ready to configure the third queue manager.
Procedure
1. Define and start a listener for PS3.
a) Launch the MQSC interface.
In the command line, enter the following command:
runmqsc PS3
b) Define a listener.
Enter the following MQSC command:
START LISTENER(PS3_LS)
IBM MQ Scenarios 37
2. Define a receiver channel for PS3, to allow other queue managers in the cluster to communicate with
it.
Enter the following MQSC command:
3. Define a sender channel from PS3 to one of the full repository queue managers (for example, PS1 ).
This joins PS3 into the cluster.
Enter the following MQSC command:
This command returns three entries, one each for QM1, QM2 and QM3. QM1 and QM2 should have a
QMTYPE of REPOS, and QM3 should have a QMTYPE of NORMAL.
What to do next
You are now ready to define a cluster topic.
Procedure
1. Define the cluster topic SCORES on PS3.
To make the topic a cluster topic, specify the name of the cluster, and set the cluster routing
( CLROUTE ) that you want to use for publications and subscriptions for this topic.
38 IBM MQ Scenarios
a) Launch the MQSC interface.
In the command line, enter the following command:
runmqsc PS3
runmqsc PS1
What to do next
For a more detailed exploration of this task, see Configuring a publish/subscribe cluster.
You are now ready to verify the solution. See “Testing the publish/subscribe cluster” on page 39.
Procedure
1. In the command line, enter the following command:
IBM MQ Scenarios 39
amqssub /Sport/Scores/Football PS3
Results
The publish/subscribe cluster set up is complete.
What to do next
Try defining different topic objects for different branches of the topic tree, and with different routing
models.
40 IBM MQ Scenarios
Figure 3. Topology diagram showing the relationship between queue managers in a typical publisher/
subscribe hierarchy.
Procedure
1. Create the queue managers.
a) Create and start three queue managers called QM1, QM2, and QM3 using the following commands:
b) Enable the queue manager publish/subscribe mode by using the following command on all three
queue managers:
2. Establish point-to-point channel connections between queue managers using a queue manager alias
with the same name as the parent queue manager.
a) Define a transmission queue and queue manager alias on QM2 to QM1. Define a sender channel to
QM1 and a receiver channel for the sender channel created on QM1 for QM2:
b) Define a transmission queue and queue manager alias on QM3 to QM1. Define sender channel to QM1
and a receiver channel for the sender channel created on QM1 for QM3:
IBM MQ Scenarios 41
DEFINE CHANNEL('QM3.TO.QM1') CHLTYPE(SDR) CONNAME('localhost(9999)') XMITQ(QM1.XMITQ)
TRPTYPE(TCP)
c) Define a transmission queue and queue manager alias on QM1 to QM2 and QM3. Define sender
channel to QM2 and QM3, and a receiver channel for the sender channels created on QM2 and QM3
for QM1:
START CHANNEL('QM1.TO.QM2')
START CHANNEL('QM1.TO.QM3')
ii) On QM2:
START CHANNEL('QM2.TO.QM1')
iii) On QM3:
START CHANNEL('QM3.TO.QM1')
DISPLAY CHSTATUS('QM1.TO.QM2')
DISPLAY CHSTATUS('QM1.TO.QM3')
DISPLAY CHSTATUS('QM2.TO.QM1')
DISPLAY CHSTATUS('QM3.TO.QM1')
g)
3. Connect the queue managers and define a topic.
Connect the child queue managers QM2 and QM3 to the parent queue manager QM1.
a) On QM2 and QM3, set the parent queue manager to QM1:
42 IBM MQ Scenarios
ALTER QMGR PARENT (QM1)
b) Run the following command on all queue managers to check that the child queue managers are
connected to the parent queue manager:
Command output is displayed. For example, here is output for QM1, with the key details highlighted:
4. Use the amqspub.exe and amqssub.exe applications to publish and subscribe the topic.
a) Run this command in the first command window:
Results
The amqssub.exe applications in the second and third command windows receive the messages
published in the first command window.
IBM MQ Scenarios 43
Figure 4. Topology diagram showing the relationship between queue managers in a typical publisher/
subscribe hierarchy.
Procedure
1. Create the queue managers.
a) Create and start three queue managers called QM1, QM2, and QM3 using the following commands:
b) Enable the queue manager publish/subscribe mode by using the following command on all three
queue managers:
2. Establish point-to-point channel connections between a queue manager using a transmission queue
with the same name as the parent queue manager.
a) Define a transmission queue on QM2 to QM1. Define a sender channel to QM1 and a receiver channel
for the sender channel for QM2 created on QM1:
b) Define a transmission queue on QM3 to QM1. Define sender channel to QM1 and a receiver channel
for the sender channel created on QM1 for QM3:
44 IBM MQ Scenarios
DEFINE CHANNEL('QM1.TO.QM3') CHLTYPE(RCVR) TRPTYPE(TCP)
c) Define transmission queues on QM1 to QM2 and QM3. Define sender channels to QM2 and QM3, and a
receiver channel for the sender channels created on QM2 and QM3 for QM1:
START CHANNEL('QM1.TO.QM2')
START CHANNEL('QM1.TO.QM3')
ii) On QM2:
START CHANNEL('QM2.TO.QM1')
iii) On QM3:
START CHANNEL('QM3.TO.QM1')
DISPLAY CHSTATUS('QM1.TO.QM2')
DISPLAY CHSTATUS('QM1.TO.QM3')
DISPLAY CHSTATUS('QM2.TO.QM1')
DISPLAY CHSTATUS('QM3.TO.QM1')
b) Run the following command on all queue managers to check that the child queue managers are
connected to the parent queue manager:
IBM MQ Scenarios 45
Command output is displayed. For example, here is output for QM1, with the key details highlighted:
4. Use the amqspub.exe and amqssub.exe applications to publish and subscribe the topic.
a) Run this command in the first command window:
Results
The amqssub.exe applications in the second and third command windows receive the messages
published in the first command window.
Related tasks
“Publish/subscribe hierarchy scenario 1: Using point-to-point channels with queue manager name alias”
on page 40
This is the first in a set of three scenarios that set up a publish/subscribe hierarchy in different ways to
establish the connection between queue managers. This scenario sets up a publish/subscribe hierarchy
that uses point-to-point channels with queue manager name alias.
“Publish/subscribe hierarchy scenario 3: Using a cluster channel to add a queue manager” on page 46
This is the third in a set of three scenarios that set up a publish/subscribe hierarchy in different ways to
establish the connection between queue managers. This scenario uses a cluster channel to add a queue
manager to a hierarchy.
Connecting a queue manager to a publish/subscribe hierarchy
46 IBM MQ Scenarios
Note: This scenario is only using the cluster configuration to connect queue managers together, not
to propagate publish/subscribe traffic through clustering topics. When defining child/parent hierarchy
relationships between queue managers in the same cluster, propagation of publications between queue
managers will occur based on the publication and subscription scope settings of the topics in the topic
tree. It is important not to use the cluster name setting of a topic to add the topics into the cluster. If using
the cluster name, the topology becomes a publish/subscribe cluster and does not require the child/parent
hierarchy relationships defined. See “Publish/subscribe cluster scenario” on page 34 and Planning your
distributed publish/subscribe network.
This scenario reuses steps 1, 3, and 4 from “Publish/subscribe hierarchy scenario 1: Using point-to-point
channels with queue manager name alias” on page 40.
This scenario creates a cluster called DEMO where QM1 and QM2 are full repositories, and QM3 is a partial
repository. Queue manager QM1 is the parent of queue managers QM2 and QM3.
Figure 5. Topology diagram showing the relationship between queue managers that are using a cluster
channel.
Procedure
1. Create the queue managers.
a) Create and start three queue managers called QM1, QM2, and QM3 using the following commands:
b) Enable the queue manager publish/subscribe mode by using the following command on all three
queue managers:
IBM MQ Scenarios 47
ALTER QMGR REPOS(DEMO)
ii) On QM2:
iii) On QM3:
d) Define a cluster sender channel to a full repository on each queue manager in the cluster:
i) On QM1:
ii) On QM2:
iii) QM3 can have a cluster sender channel to either full repository on QM1 or QM2. This example
defines the channel to QM1:
b) Run the following command on all queue managers to check that the child queue managers are
connected to the parent queue manager:
Command output is displayed. For example, here is output for QM1, with the key details highlighted:
48 IBM MQ Scenarios
AMQ8723: Display pub/sub status details.
QMNAME(QM1) TYPE(LOCAL)
STATUS(ACTIVE) SUBCOUNT(6)
TPCOUNT(9)
AMQ8723: Display pub/sub status details.
QMNAME(QM2) TYPE(CHILD)
STATUS(ACTIVE) SUBCOUNT(NONE)
TPCOUNT(NONE)
AMQ8723: Display pub/sub status details.
QMNAME(QM3) TYPE(CHILD)
STATUS(ACTIVE) SUBCOUNT(NONE)
TPCOUNT(NONE)
4. Use the amqspub.exe and amqssub.exe applications to publish and subscribe the topic.
a) Run this command in the first command window:
Results
The amqssub.exe applications in the second and third command windows receive the messages
published in the first command window.
Related tasks
“Publish/subscribe hierarchy scenario 1: Using point-to-point channels with queue manager name alias”
on page 40
This is the first in a set of three scenarios that set up a publish/subscribe hierarchy in different ways to
establish the connection between queue managers. This scenario sets up a publish/subscribe hierarchy
that uses point-to-point channels with queue manager name alias.
“Publish/subscribe hierarchy scenario 2: Using point-to-point channels with same name for transmission
queue and remote queue manager” on page 43
This is the second in a set of three scenarios that set up a publish/subscribe hierarchy in different ways
to establish the connection between queue managers. This scenario sets up a publish/subscribe hierarchy
that uses point-to-point channels with the transmission queue name the same as the remote queue
manager.
Connecting a queue manager to a publish/subscribe hierarchy
IBM MQ Scenarios 49
This topic introduces and defines the general concepts of unit of work, commit, backout and sync point. It
also contains two scenarios that illustrate global units of work.
50 IBM MQ Scenarios
• “Scenario 1: Queue manager performs the coordination” on page 51
• “Scenario 2: Other software provides the coordination” on page 75
Isolation level
In IBM MQ, a message on a queue might be visible before a database update, depending on the
transaction isolation design implemented within the database.
When an IBM MQ queue manager is working as an XA transaction manager, to coordinate updates to XA
resource managers, the following commit protocol is followed:
1. Prepare all XA resource managers.
2. Commit the IBM MQ queue manager resource manager.
3. Commit other resource managers.
Between step 2 and 3, an application might see a message that is committed to the queue but the
corresponding row in the database does not reflect this message.
This is not a problem if the database is configured such that the application's database API calls wait for
pending updates to be completed.
You can resolve this by configuring the database differently. The type of configuration needed is referred
to as the "isolation level". For more information on isolation levels, refer to the database documentation.
You can, alternatively, configure the queue manager to commit the resource managers in the following
reverse order:
1. Prepare all XA resource managers.
2. Commit other resource managers.
3. Commit the IBM MQ queue manager resource manager.
When you change the protocol the IBM MQ queue manager is committed last, so applications that
read messages from the queues see a message only after the corresponding database update has been
completed.
To configure the queue manager to use this changed protocol, set the AMQ_REVERSE_COMMIT_ORDER
environment variable.
Set this environment variable in the environment from which the strmqm is run to start the queue
manager. For example, run the following in the shell just before starting the queue manager:
export AMQ_REVERSE_COMMIT_ORDER=1
Note: Setting this environment variable might cause an extra log entry per transaction, so this will have a
small impact on the performance of each transaction.
Database coordination
When the queue manager coordinates global units of work itself, it becomes possible to integrate
database updates within the units of work. That is, a mixed MQI and SQL application can be written,
and the MQCMIT and MQBACK verbs can be used to commit or roll back the changes to the queues and
databases together.
The queue manager achieves this using the two-phase commit protocol described in X/Open Distributed
Transaction Processing: The XA Specification. When a unit of work is to be committed, the queue manager
first asks each participating database manager whether it is prepared to commit its updates. Only if all the
IBM MQ Scenarios 51
participants, including the queue manager itself, are prepared to commit, are all the queue and database
updates committed. If any participant cannot prepare its updates, the unit of work is backed out instead.
In general, a global unit of work is implemented in an application by the following method (in
pseudocode):
MQBEGIN
MQGET (include the flag MQGMO_SYNCPOINT in the message options)
MQPUT (include the flag MQPMO_SYNCPOINT in the message options)
SQL INSERT
MQCMIT
The purpose of MQBEGIN is to denote the beginning of a global unit of work. The purpose of MQCMIT is
to denote the end of the global unit of work, and to complete it with all participating resource managers,
using the two-phase commit protocol.
When the unit of work (also known as a transaction ) is completed successfully using MQCMIT, all actions
taken within that unit of work are made permanent or irreversible. If, for any reason, the unit of work fails,
all actions are instead backed out. It is not possible for one action in a unit of work to be made permanent
while another is backed out. This is the principle of a unit of work: either all actions within the unit of work
are made permanent or none of them are.
Note:
1. The application programmer can force a unit of work to be backed out by calling MQBACK. The unit of
work is also backed out by the queue manager if the application or database fails before MQCMIT is
called.
2. If an application calls MQDISC without calling MQCMIT, the queue manager behaves as if MQCMIT had
been called, and commits the unit of work.
In between MQBEGIN and MQCMIT, the queue manager does not make any calls to the database to
update its resources. That is, the only way a database's tables are changed is by your code (for example,
the SQL INSERT in the pseudocode).
Full recovery support is provided if the queue manager loses contact with any of the database managers
during the commit protocol. If a database manager becomes unavailable while it is in doubt, that is, it has
successfully prepared to commit, but has yet to receive a commit or backout decision, the queue manager
remembers the outcome of the unit of work until that outcome has been successfully delivered to the
database. Similarly, if the queue manager terminates with incomplete commit operations outstanding,
these are remembered over queue manager restart. If an application terminates unexpectedly, the
integrity of the unit of work is not compromised, but the outcome depends on where in the process
the application terminated, as described in Table 2 on page 53.
What happens when the database or application program fails is summarized in the following tables:
52 IBM MQ Scenarios
Table 1. What happens when a database server fails (continued)
Failure occurrence Outcome
After the application call to MQCMIT. The unit of work is committed with a reason code
of MQRC_NONE.
In the case where the reason code on return from MQCMIT is MQRC_OUTCOME_PENDING, the unit of
work is remembered by the queue manager until it has been able to reestablish contact with the database
server, and tell it to commit its part of the unit of work. Refer to “Considerations when contact is lost with
the XA resource manager” on page 69 for information on how and when recovery is done.
The queue manager communicates with database managers using the XA interface as described in
X/Open Distributed Transaction Processing: The XA Specification. Examples of these function calls are
xa_open, xa_start, xa_end, xa_prepare, and xa_commit. We use the terms transaction manager and
resource manager in the same sense as they are used in the XA specification.
Restrictions
There are restrictions to the database coordination support.
The following restrictions apply:
• The ability to coordinate database updates within IBM MQ units of work is not supported in an MQI
client application. The use of MQBEGIN in a client application fails. A program that calls MQBEGIN must
run as a server application on the same machine as the queue manager.
Note: A server application is a program that has been linked with the necessary IBM MQ server libraries;
a client application is a program that has been linked with the necessary IBM MQ client libraries.
See Building applications for IBM MQ MQI clients and Building a procedural application for details on
compiling and linking programs that you write in a procedural language.
• The database server can reside on a different machine from the queue manager server, as long as the
database client is installed on the same machine as the queue manager, and it supports this function.
Consult the database product's documentation to determine whether their client software can be used
for two-phase commit systems.
• Although the queue manager behaves as a resource manager (for the purposes of being involved in
Scenario 2 global units of work), it is not possible to make one queue manager coordinate another
queue manager within its Scenario 1 global units of work.
IBM MQ Scenarios 53
• On Windows and Linux (x86 and x86-64 platforms) systems, use the IBM MQ Explorer to update the
qm.ini file.
• On all other systems edit the file, qm.ini, directly.
The C source for the switch load file is supplied with the IBM MQ installation if it supports Scenario 1
global units of work. The source contains a function called MQStart. When the switch load file is loaded,
the queue manager calls this function, which returns the address of a structure called an XA switch.
The XA switch structure exists in the database client shared library, and contains a number of function
pointers, as described in Table 3 on page 54:
During the first MQBEGIN call in your application, the IBM MQ code that executes as part of MQBEGIN
loads the switch load file, and calls the xa_open function in the database shared library. Similarly, during
queue manager startup, and on other subsequent occasions, some queue manager processes load the
switch load file and call xa_open.
You can reduce the number of xa_* calls by using dynamic registration. For a complete description of this
optimization technique, see “XA dynamic registration” on page 73.
54 IBM MQ Scenarios
Installing and configuring the database product
To install and configure your database product, see the product's own documentation. This topics in this
section describe general configuration issues and how they relate to interoperation between IBM MQ and
the database.
Database connections
An application that establishes a standard connection to the queue manager is associated with a thread
in a separate local queue manager agent process. (A connection that is not a fastpath connection is a
standard connection in this context. See Connecting to a queue manager using the MQCONNX call.)
When the application issues MQBEGIN, both it and the agent process call the xa_open function in the
database client library. In response to this, the database client library code connects to the database
that is to be involved in the unit of work from both the application and queue manager processes.
These database connections are maintained as long as the application remains connected to the queue
manager.
This is an important consideration if the database supports only a limited number of users or connections,
because two connections are being made to the database to support the one application program.
Client/server configuration
The database client library that is loaded into the IBM MQ queue manager and application processes
must be able to send to and receive from its server. Ensure that:
• The database's client/server configuration files have the correct details
• The relevant environment variables are set in the environment of the queue manager and the
application processes
If you have 32-bit queue managers then the sample make file, xaswit.mak,
installs a 32-bit switch load file in /var/mqm/exits.
If you have 64-bit queue managers then the sample make file, xaswit.mak,
installs a 32-bit switch load file in /var/mqm/exits, and a 64-bit switch load file in /var/mqm/
exits64.
IBM MQ Scenarios 55
• For Db2, db2swit64
• For Oracle, oraswit64
• For Informix, infswit64
• For Sybase, sybswit64
File security
It is possible that your operating system might fail the loading of the switch load file by IBM MQ, for
reasons outside the control of IBM MQ. If this occurs, error messages are written to the IBM MQ error
logs, and potentially the MQBEGIN call can fail. To help to ensure that your operating system does not fail
the loading of the switch load file, you must fulfil the following requirements:
1. The switch load file must be available in the location that is given in the qm.ini file.
2. The switch load file must be accessible to all processes that need to load it, including the queue
manager processes and application processes.
3. All of the libraries upon which the switch load file depends, including the libraries that are provided by
the database product, must be present and accessible.
56 IBM MQ Scenarios
XAOpenString=string
This is a string of data that IBM MQ code passes in its calls to the database manager's xa_open
function. This is an optional attribute; if it is omitted a zero-length string is assumed.
The code in the queue manager and IBM MQ application processes call the xa_open function on two
occasions:
1. At queue manager startup
2. When you make the first call to MQBEGIN in your IBM MQ application process
The format for this string is particular to each database product, and will be described in the
documentation for that product. In general, the xa_open string contains authentication information
(user name and password) to allow a connection to the database in both the queue manager and the
application processes.
From IBM MQ 8.0.0 Fix Pack 4, when the XAOpenString contains a password, you can get IBM MQ to
protect this information, rather than having the password visible in plain text in the qm.ini file. IBM
MQ stores the user name and the password (in an encrypted form) in a different file, and uses these
credentials to connect to the database. For details, see Protection of database authentication details.
XACloseString=string
This is a string of data that IBM MQ code passes in its calls to the database manager's xa_close
function. This is an optional attribute; if it is omitted a zero-length string is assumed.
The code in the queue manager and IBM MQ application processes call the xa_close function on two
occasions:
1. At queue manager startup
2. When you make a call to MQDISC in your IBM MQ application process, having earlier made a call to
MQBEGIN
The format for this string is particular to each database product, and will be described in the
documentation for that product. In general, the string is empty, and it is common to omit the
XACloseString attribute from the XAResourceManager stanza.
ThreadOfControl=THREAD|PROCESS (default)
The ThreadOfControl value can be THREAD or PROCESS. The queue manager uses it for serialization
purposes. This is an optional attribute; if it is omitted, the value PROCESS is assumed.
If the database client code allows threads to call the XA functions without serialization, the value for
ThreadOfControl can be THREAD. The queue manager assumes that it can call the XA functions in the
database client shared library from multiple threads at the same time, if necessary.
If the database client code does not allow threads to call its XA functions in this way, the value
for ThreadOfControl must be PROCESS. In this case, the queue manager serializes all calls to the
database client shared library so that only one call at a time is made from within a particular process.
You probably also need to ensure that your application performs similar serialization if it runs with
multiple threads.
Note that this issue, of the database product's ability to cope with multi-threaded processes in this
way, is an issue for that product's vendor. Consult the database product's documentation for details
on whether you can set the ThreadOfControl attribute to THREAD or PROCESS. We recommend that,
if you can, you set ThreadOfControl to THREAD. If in doubt, the safer option is to set it to PROCESS,
although you will lose the potential performance benefits of using THREAD.
IBM MQ Scenarios 57
MQBEGIN
MQGET
MQPUT
SQL INSERT
MQCMIT
The purpose of MQBEGIN is to denote the beginning of a global unit of work. The purpose of MQCMIT is
to denote the end of the global unit of work, and to complete it with all participating resource managers,
using the two-phase commit protocol.
In between MQBEGIN and MQCMIT, the queue manager does not make any calls to the database to
update its resources. That is, the only way a database's tables are changed is by your code (for example,
the SQL INSERT in the pseudocode).
The role of the queue manager, as far as the database is concerned, is to tell it when a global unit of work
has started, when it has ended, and whether the global unit of work should be committed or rolled-back.
As far as your application is concerned, the queue manager performs two roles: a resource manager
(where the resources are messages on queues) and the transaction manager for the global unit of work.
Start with the supplied sample programs, and work through the various IBM MQ and database API calls
that are being made in those programs. The API calls concerned are fully documented in Sample IBM
MQ procedural programs, Data types used in the MQI, and (in the case of the database's own API) the
database's own documentation.
Configuring Db2
Db2 support and configuration information.
The supported levels of Db2 are defined at the System Requirements for IBM MQ page.
Note: 32-bit instances of Db2 are not supported on platforms where the queue manager is 64-bit.
Do the following:
1. Check the environment variable settings.
2. Create the Db2 switch load file.
3. Add resource manager configuration information.
4. Change Db2 configuration parameters if necessary.
Read this information in conjunction with the general information provided in “Configuring your system for
database coordination” on page 54.
Warning: If you run db2profile on AIX and Linux platforms, the environment variable LIBPATH and
LD_LIBRARY_PATH are set. It is advisable to unset these environment variables. See crtmqenv or
setmqenv for more information.
58 IBM MQ Scenarios
• On AIX and Linux systems, use:
export DB2INSTANCE=db2inst1
set DB2INSTANCE=Db2
On Windows with a Db2 database, you must add the user MUSR_MQADMIN to the DB2USERS group, to
enable the queue manager to start.
If your system does not support 32-bit compilation, use the 64-bit only target:
IBM MQ Scenarios 59
XAResourceManager:
Name=mydb2
SwitchFile=db2swit
XAOpenString=mydbname,myuser,mypasswd,toc=t
ThreadOfControl=THREAD
Note:
1. ThreadOfControl=THREAD cannot be used with Db2 versions earlier than 8. Set
ThreadOfControl and the XAOpenString parameter toc to one of the following combinations:
• ThreadOfControl=THREAD and toc=t
• ThreadOfControl=PROCESS and toc=p
If you are using the jdbcdb2 XA switch load file to enable JDBC/JTA coordination, you must use
ThreadOfControl=PROCESS and toc=p.
60 IBM MQ Scenarios
Reset the maxappls parameter
You might need to review your setting for the maxappls parameter, which limits the maximum number
of applications that can be connected to a database. Refer to “Installing and configuring the database
product” on page 55.
Configuring Oracle
Oracle support and configuration information.
Complete the following steps:
1. Check environment variable settings.
2. Create the Oracle switch load file.
3. Add resource manager configuration information.
4. Change the Oracle configuration parameters, if necessary.
For a current list of levels of Oracle supported by IBM MQ, see System Requirements for IBM MQ.
export ORACLE_HOME=/opt/oracle/product/8.1.6
set ORACLE_HOME=c:\oracle\ora81
ORACLE_SID
The Oracle SID being used. If you are using Net8 for client/server connectivity, you might not have to
set this environment variable. Consult your Oracle documentation.
The subsequent example is an example of setting this environment variable, on AIX and Linux
systems:
export ORACLE_SID=sid1
set ORACLE_SID=sid1
Note: The PATH environment variable must be set to include the binaries directory (for
example ORACLE_INSTALL_DIR/VERSION/32BIT_NAME/bin or ORACLE_INSTALL_DIR/VERSION/
64BIT_NAME/bin), otherwise you might see a message stating that oraclient libraries are missing from
the machine.
If you run queue managers on Windows 64 bit systems, then only 64 bit Oracle clients must be installed.
The switch load file, loaded by 64 bit queue managers, must access the Oracle 64 bit client libraries.
IBM MQ Scenarios 61
On Windows systems, you can find xaswit.mak in the directory C:\Program
Files\IBM\MQ\tools\c\samples\xatm. To create the Oracle switch load file with Microsoft Visual
C++, use:
Note: These switch load files can be used only with C applications. For Java applications, see JTA/JDBC
coordination using IBM MQ classes for Java.
The generated switch file is placed in MQ_INSTALLATION_PATH\exits. MQ_INSTALLATION_PATH
represents the high-level directory in which IBM MQ is installed.
If your system does not support 32-bit compilation, use the 64-bit only target:
XAResourceManager:
Name=myoracle
SwitchFile=oraswit
XAOpenString=Oracle_XA+Acc=P/myuser/mypasswd+SesTm=35+LogDir=/tmp+threads=true
ThreadOfControl=THREAD
Figure 7. Sample XAResourceManager entry for Oracle on AIX and Linux platforms
Note:
62 IBM MQ Scenarios
1. In Figure 7 on page 62, the xa_open string has been used with four parameters. Additional parameters
can be included as described in Oracle's documentation.
2. When using the IBM MQ parameter ThreadOfControl=THREAD you must use the Oracle parameter
+threads=true in the XAResourceManager stanza.
See the Oracle8 Server Application Developer's Guide for more information about the xa_open string.
Configuring Informix
Informix support and configuration information.
Complete the following steps:
1. Ensure that you have installed the appropriate Informix client SDK:
• 32 bit queue managers and applications require a 32 bit Informix client SDK.
• 64 bit queue managers and applications require a 64 bit Informix client SDK.
2. Ensure that Informix databases are created correctly.
3. Check environment variable settings.
4. Build the Informix switch load file.
5. Add resource manager configuration information.
For a current list of levels of Informix supported by IBM MQ, see System Requirements for IBM MQ.
IBM MQ queue managers are unable to coordinate Informix databases that do not have the log
parameter specified on creation. If a queue manager attempts to coordinate an Informix database that
does not have the log parameter specified on creation, the xa_open call to Informix fails, and a number
of FFST errors are generated.
IBM MQ Scenarios 63
INFORMIXDIR
The directory of the Informix product installation.
• For 32 bit AIX and Linux applications, use the following command:
export INFORMIXDIR=/opt/informix/32-bit
• For 64 bit AIX and Linux applications, use the following command:
export INFORMIXDIR=/opt/informix/64-bit
set INFORMIXDIR=c:\informix
For systems that have 64 bit queue managers that must support both 32 bit and 64 bit applications,
you need both the Informix 32 bit and 64 bit client SDKs installed. The sample makefile xaswit.mak,
used for creating a switch load file also sets both product installation directories.
INFORMIXSERVER
The name of the Informix server. For example, on AIX and Linux systems, use:
export INFORMIXSERVER=hostname_1
set INFORMIXSERVER=hostname_1
ONCONFIG
The name of the Informix server configuration file. For example, on AIX and Linux systems, use:
export ONCONFIG=onconfig.hostname_1
set ONCONFIG=onconfig.hostname_1
64 IBM MQ Scenarios
Edit xaswit.mak to uncomment the lines appropriate to the version of Informix you are using. Then
execute the makefile using the command:
If your system does not support 32-bit compilation, use the 64-bit only target:
XAResourceManager:
Name=myinformix
SwitchFile=infswit
XAOpenString=DB=mydbname@myinformixserver\;USER=myuser\;PASSWD=mypasswd
ThreadOfControl=THREAD
Note: By default the sample xaswit.mak on UNIX creates a switch load file that uses threaded Informix
libraries. You must ensure that ThreadOfControl is set to THREAD when using these Informix libraries.
In Figure 8 on page 65, the qm.ini file XAResourceManager stanza attribute ThreadOfControl is set to
THREAD. When THREAD is specified, applications must be built using the threaded Informix libraries and
the IBM MQ threaded API libraries.
The XAOpenString attribute must contain the database name, followed by the @ symbol, and then
followed by the Informix server name.
To use the nonthreaded Informix libraries, you must ensure that the qm.ini file XAResourceManager
stanza attribute ThreadOfControl is set to PROCESS. You must also make the following changes to the
sample xaswit.mak:
1. Uncomment the generation of a nonthreaded switch load file.
2. Comment out the generation of the threaded switch load file.
Sybase configuration
Sybase support and configuration information.
Complete the following steps:
1. Ensure you have installed the Sybase XA libraries, for example by installing the XA DTM option.
2. Check environment variable settings.
IBM MQ Scenarios 65
3. Enable Sybase XA support.
4. Create the Sybase switch load file.
5. Add resource manager configuration information.
For a current list of levels of Sybase supported by IBM MQ, see System Requirements for IBM MQ.
export SYBASE=/sybase
set SYBASE=c:\sybase
SYBASE_OCS
The directory under SYBASE where you have installed the Sybase client files.
export SYBASE_OCS=OCS-12_0
set SYBASE_OCS=OCS-12_0
[xa]
LRM=lrmname
server=servername
66 IBM MQ Scenarios
The generated switch file is placed in C:\Program Files\IBM\MQ\exits.
If your system does not support 32-bit compilation, use the 64-bit only target:
Note: On AIX, the sample makefile has been modified as shown in the following example
so that you can select a different SYBLINKFLAG64 value, depending on whether you are using Sybase 15
ESD#5 or later, or an earlier version of Sybase.
SYBLINKFLAGS32=-brtl
# The following line is for Sybase 15
#SYBLINKFLAGS64=-brtl
# The following line is for Sybase 16
SYBLINKFLAGS64=-bstatic -bdynamic
The only change you need to make to the makefile is to ensure that only one of the SYBLINKFLAGS64
values is uncommented. The default is Sybase 16, which is the value to use for 15 #ESD5 and later.
Any XA switch file that is produced is linked to that specific release of Sybase and must not be moved to
other platforms.
If the level of Sybase is changed, then the XA switch file should be rebuilt.
• On Windows and Linux (x86 and x86-64 platforms) systems, use the IBM
MQ Explorer. Specify the details of the switch load file in the queue manager properties panel, under XA
resource manager.
• On all other systems specify the details of the switch load file in the XAResourceManager stanza in the
queue manager's qm.ini file.
XAResourceManager:
Name=mysybase
SwitchFile=sybswit
XAOpenString=-Uuser -Ppassword -Nlrmname -L/tmp/sybase.log -Txa
ThreadOfControl=THREAD
IBM MQ Scenarios 67
Using multi-threaded programs with Sybase
If you are using multi-threaded programs with IBM MQ global units of work incorporating updates to
Sybase, you must use the value THREAD for the ThreadOfControl parameter. Also ensure that you link
your program (and the switch load file) with the threadsafe Sybase libraries (the _r versions). Using the
value THREAD for the ThreadOfControl parameter is shown in the previous example.
XAResourceManager:
Name=DB2 MQBankDB
SwitchFile=db2swit
XAOpenString=MQBankDB
XAResourceManager:
Name=DB2 MQFeeDB
SwitchFile=db2swit
XAOpenString=MQFeeDB
XAResourceManager:
Name=DB2 MQBankDB
SwitchFile=db2swit
XAOpenString=MQBankDB
XAResourceManager:
Name=Oracle MQFeeDB
SwitchFile=oraswit
XAOpenString=Oracle_XA+Acc=P/myuser/mypassword+SesTm=35+LogDir=/tmp/ora.log+DB=MQFeeDB
Figure 10. Sample XAResourceManager entries for a Db2 and Oracle database
In principle, there is no limit to the number of database instances that can be configured with a single
queue manager.
Note: For information on support for including Informix databases in multiple database updates within
global units of work, check the product readme file.
68 IBM MQ Scenarios
Security considerations
Considerations for running your database under the XA model.
The following information is provided for guidance only. In all cases, refer to the documentation provided
with the database manager to determine the security implications of running your database under the XA
model.
An application process denotes the start of a global unit of work using the MQBEGIN verb. The first
MQBEGIN call that an application issues connects to all participating databases by calling their client
library code at the xa_open entry point. All the database managers provide a mechanism for supplying a
user ID and password in their XAOpenString. This is the only time that authentication information flows.
Note that, on AIX and Linux platforms, fastpath applications must run with an effective user ID of mqm
while making MQI calls.
IBM MQ Scenarios 69
If, for some reason, you cannot wait for the queue manager to resynchronize with the database
automatically, you can use facilities provided by the database manager to commit or roll back the
database updates manually. In the X/Open Distributed Transaction Processing: The XA Specification,
this is called making a heuristic decision. Use it only as a last resort because of the possibility of
compromising data integrity; you might, for example, mistakenly roll back the database updates when
all other participants have committed their updates.
It is far better to restart the queue manager, or use the rsvmqtrn command when the database has been
restarted, to initiate automatic resynchronization.
dspmqtrn -m MY_QMGR
70 IBM MQ Scenarios
AMQ7107: Resource manager 0 is MQSeries.
AMQ7107: Resource manager 1 is DB2 MQBankDB.
AMQ7107: Resource manager 2 is DB2 MQFeeDB.
where Transaction number is the ID of the transaction which can be used with the rsvmqtrn
command. See AMQ7xxx: IBM MQ product messages for further information. The XID variables are
part of the X/Open XA Specification ; for the most up-to-date information about this specification see:
https://publications.opengroup.org/c193.
Figure 11. Sample dspmqtrn output
The output in Sample dspmqtrn output shows that there are three resource managers associated with
the queue manager. The first is resource manager 0, which is the queue manager itself. The other two
resource manager instances are the MQBankDB and MQFeeDB Db2 databases.
The example shows only a single in-doubt unit of work. A message is issued for all three resource
managers, which means that updates were made to the queue manager and both Db2 databases within
the unit of work.
The updates made to the queue manager, resource manager 0, have been committed. The updates to
the Db2 databases are in the prepared state, which means that Db2 must have become unavailable
before it was called to commit the updates to the MQBankDB and MQFeeDB databases.
The in-doubt unit of work has an external identifier called an XID (transaction id). This is a piece of data
given to Db2 by the queue manager to identify its portion of the global unit of work.
See dspmqtrn for more information.
IBM MQ Scenarios 71
Mixed outcomes are mainly caused when heuristic decisions are made about units of work instead of
allowing the queue manager to resolve in-doubt units of work itself. Such decisions are outside the queue
manager's control.
Whenever the queue manager detects a mixed outcome, it produces FFST information and documents the
failure in its error logs, with one of two messages:
• If a database manager rolls back instead of committing:
AMQ7607 A transaction has been rolled back but one or more resource
managers have committed.
Further messages identify the databases that are heuristically damaged. It is then your responsibility to
locally restore consistency to the affected databases. This is a complicated procedure in which you need
first to isolate the update that has been wrongly committed or rolled back, then to undo or redo the
database change manually.
If you need to change the configuration information you can do so at any time, but the changes do not
take effect until after the queue manager has been restarted.
If you remove the resource manager configuration information for a database, you are effectively
removing the ability for the queue manager to contact that database manager.
Never change the Name attribute in any of your resource manager configuration information. This
attribute uniquely identifies that database manager instance to the queue manager. If you change this
unique identifier, the queue manager assumes that the database has been removed and a completely
new instance has been added. The queue manager still associates outstanding units of work with the old
Name, possibly leaving the database in an in-doubt state.
72 IBM MQ Scenarios
involving all the other participants. Here is an example of a commented-out XAResourceManager stanza
follows:
Figure 12. Commented- out XAResourceManager stanza on AIX and Linux systems
On Windows systems, use the IBM MQ Explorer to delete the information about the database manager
instance. Take great care to type in the correct name in the Name field when reinstating it. If you mistype
the name, you may face in-doubt problems, as described in “Changing configuration information” on page
72.
XA dynamic registration
The XA specification provides a way of reducing the number of xa_* calls that a transaction manager
makes to a resource manager. This optimization is known as dynamic registration.
Dynamic registration is supported by Db2. Other databases might support it; consult the documentation
for your database product for details.
Why is the dynamic registration optimization useful? In your application, some global units of work might
contain updates to database tables; others might not contain such updates. When no persistent update
has been made to a database's tables, there is no need to include that database in the commit protocol
that occurs during MQCMIT.
Whether or not your database supports dynamic registration, your application calls xa_open during the
first MQBEGIN call on an IBM MQ connection. It also calls xa_close on the subsequent MQDISC call.
The pattern of subsequent XA calls depends on whether the database supports dynamic registration:
If your database does not support dynamic registration...
Every global unit of work involves several XA function calls made by IBM MQ code into the database
client library, regardless of whether you made a persistent update to the tables of that database
within your unit of work. These include:
• xa_start and xa_end from the application process. These are used to declare the beginning and
end of a global unit of work.
• xa_prepare, xa_commit, and xa_rollback from the queue manager agent process, amqzlaa0.
These are used to deliver the outcome of the global unit of work: the commit or rollback decision.
In addition, the queue manager agent process also calls xa_open during the first MQBEGIN.
If your database supports dynamic registration...
The IBM MQ code makes only those XA function calls that are necessary. For a global unit of work that
has not involved persistent updates to database resources, there are no XA calls to the database. For
a global unit of work that has involved such persistent updates, the calls are to:
• xa_end from the application process to declare the end of the global unit of work.
• xa_prepare, xa_commit, and xa_rollback from the queue manager agent process, amqzlaa0.
These are used to deliver the outcome of the global unit of work: the commit or rollback decision.
For dynamic registration to work, it is vital that the database has a way of telling IBM MQ when it has
performed a persistent update that it wants to be included in the current global unit of work. IBM MQ
provides the ax_reg function for this purpose.
The database's client code that runs in your application process finds the ax_reg function and calls
it, to dynamically register the fact it has done persistent work within the current global unit of work.
IBM MQ Scenarios 73
In response to this ax_reg call, IBM MQ records that the database has participated. If this is the first
ax_reg call on this IBM MQ connection, the queue manager agent process calls xa_open.
The database client code make this ax_reg call when it is running in your process, for example, during an
SQL UPDATE call or whatever call in the database's client API is responsible
Error conditions
In XA dynamic registration there is a possibility of a confusing failure in the queue manager.
A common example is if you forget to set your database environment variables properly before starting
your queue manager, the queue manager's calls to xa_open fail. No global units of work can be used.
To avoid this, ensure that you have set the relevant environment variables before starting the queue
manager. Review your database product's documentation, and the advice given in “Configuring Db2” on
page 58, “Configuring Oracle” on page 61, and “Sybase configuration” on page 65.
With all database products, the queue manager calls xa_open once at queue manager startup, as part of
the recovery session (as explained in “Considerations when contact is lost with the XA resource manager”
on page 69 ). This xa_open call fails if you set your database environment variables incorrectly, but it
does not cause the queue manager to fail to start. This is because the same xa_open error code is used
by the database client library to indicate that the database server is unavailable. IBM MQ does not treat
this as a serious error, as the queue manager must be able to start to continue processing data outside
global units of work involving that database.
Subsequent calls to xa_open are made from the queue manager during the first MQBEGIN on an IBM MQ
connection (if dynamic registration is not being used) or during a call by the database client code to the
IBM MQ-provided ax_reg function (if dynamic registration is being used).
The timing of any error conditions (or, occasionally, FFST reports) depends on whether you are using
dynamic registration:
• If you are using dynamic registration, your MQBEGIN call could succeed, but your SQL UPDATE (or
similar) database call will fail.
• If you are not using dynamic registration, your MQBEGIN call will fail.
Ensure that your environment variables are set correctly in your application and queue manager
processes.
Summarizing XA calls
Here is a list of the calls that are made to the XA functions in a database client library as a result of
the various MQI calls that control global units of work. This is not a complete description of the protocol
described in the XA specification; it is provided as a brief overview.
Note that xa_start and xa_end calls are always called by IBM MQ code in the application process,
whereas xa_prepare, xa_commit, and xa_rollback are always called from the queue manager agent
process, amqzlaa0.
The xa_open and xa_close calls shown in this table are all made from the application process. The
queue manager agent process calls xa_open in the circumstances described in “Error conditions” on
page 74.
74 IBM MQ Scenarios
Table 4. Summary of XA function calls (continued)
MQI call XA calls made with dynamic XA calls made without dynamic
registration registration
MQCMIT ( without ax_reg being No XA calls
called during the current global xa_end
unit of work) xa_prepare
xa_commit
xa_rollback
Notes:
1. For MQCMIT, xa_commit is called if xa_prepare is successful. Otherwise, xa_rollback is called.
IBM MQ Scenarios 75
5. The sync point coordinator completes the transaction by issuing the appropriate calls to each resource
manager, typically using two-phase commit protocols.
The supported levels of external sync point coordinators that can provide a two-phase commit process for
transactions in which IBM MQ participates are defined at System Requirements for IBM MQ.
The rest of this section describes how to enable external units of work.
mqmxa.dll mqcxa.dll
Windows
libmqmxa.a libmqcxa.a
AIX
(nonthreaded)
libmqmxa_r.a libmqcxa_r.a
AIX (threaded)
libmqmxa.so libmqcxa.so
Linux
(nonthreaded)
libmqmxa_r.so libmqcxa_r.so
Linux
(threaded)
76 IBM MQ Scenarios
Table 6. Alternative 64-bit XA switch load file names
Platform Switch load file name Switch load file name
(server) (extended transactional client)
libmqmxa64.a libmqcxa64.a
AIX
(nonthreaded)
libmqmxa64_r.a libmqcxa64_r.a
AIX (threaded)
libmqmxa64.so libmqcxa64.so
Linux
(nonthreaded)
libmqmxa64_r.so libmqcxa64_r.so
Linux
(threaded)
Some external sync point coordinators (not CICS ) require that each resource manager participating in a
unit of work supplies its name in the name field of the XA switch structure. The IBM MQ resource manager
name is MQSeries_XA_RMI.
The sync point coordinator defines how the IBM MQ XA switch structure links to it. Information
about linking the IBM MQ XA switch structure with CICS is provided in “Using CICS” on page 78.
For information about linking the IBM MQ XA switch structure with other XA-compliant sync point
coordinators, consult the documentation supplied with those products.
The following considerations apply to using IBM MQ with all XA-compliant sync point coordinators:
• It is expected that the transaction manager library code (running as part of their API that the application
programmer has called) will call xa_open into IBM MQ at some point, before calling MQCONN.
The xa_open call must be made on the same thread where the MQCONN call is made. The reason for
this requirement, is that the XA specification requires that the thread is used to imply context.
Note that this is the approach taken in sample program amqstxsx.c. This sample program assumes
that an xa_open call is made into IBM MQ, from the library code of the transaction manager, within
their function tpopen).
If no xa_open call is made on the same thread, before the MQCONN call, then the IBM MQ queue
manager connection will not be associated with an XA context.
For more information, see MQCTL.
• The xa_info structure passed on any xa_open call by the sync point coordinator includes the name of
an IBM MQ queue manager. The name takes the same form as the queue manager name passed to the
MQCONN call. If the name passed on the xa_open call is blank, the default queue manager is used.
Alternatively, the xa_info structure can contain values for the TPM and AXLIB parameters. The TPM
parameter specifies the transaction manager being used. The valid values are CICS, TUXEDO and
ENCINA. The AXLIB parameter specifies the name of the library that contains the transaction manager's
ax_reg and ax_unreg functions. For more information on these parameters, see Configuring an extended
transactional client. If the xa_info structure contains either of these parameters, the queue manager
name is specified in the QMNAME parameter, unless the default queue manager is being used.
• Only one queue manager at a time can participate in a transaction coordinated by an instance of
an external sync point coordinator. The sync point coordinator is effectively connected to the queue
manager, and is subject to the rule that only one connection at a time is supported.
• All applications that include calls to an external sync point coordinator can connect only to the queue
manager that is participating in the transaction managed by the external coordinator (because they
are already effectively connected to that queue manager). However, such applications must issue an
MQCONN call to obtain a connection handle, and an MQDISC call before they exit.
IBM MQ Scenarios 77
• A queue manager with resource updates coordinated by an external sync point coordinator must start
before the external sync point coordinator. Similarly, the sync point coordinator must end before the
queue manager.
• If your external sync point coordinator terminates abnormally, stop and restart your queue manager
before restarting the sync point coordinator to ensure that any messaging operations uncommitted at
the time of the failure are properly resolved.
Using CICS
CICS is one of the elements of TXSeries.
The versions of TXSeries that are XA-compliant (and use a two-phase commit process) are defined in the
System Requirements for IBM MQ information.
IBM MQ also supports other transaction managers. See the System Requirements for IBM MQ web page
for links to information about supported software.
General XA support
An XA switch load module is provided to enable you to link CICS with IBM MQ for AIX, Linux, and Windows
systems. Additionally, sample source code files are provided to enable you to develop the XA switches for
other transaction messages. General XA is not supported on IBM i.
The names of the switch load modules provided are as follows:
78 IBM MQ Scenarios
Table 7. Essential code for CICS applications: XA initialization routine
amqzscix.c
amqzsc - TXSeries for AIX 5.1
amqzscin.c
mqmc4swi - TXSeries for Windows 5.1
AIX
Issue the following command:
export MQM_HOME=/usr/mqm
echo "amqzscix" > tmp.exp
xlc_r $MQM_HOME/samp/amqzscix.c -I/usr/lpp/cics/include -I$MQM_HOME/inc -e amqzscix -bE:tmp.exp -bM:SRE
-o amqzsc /usr/lpp/cics/lib/regxa_swxa.o -L$MQM_HOME/lib -L/usr/lpp/cics/lib -lcicsrt -lEncina
-lEncServer -lpthreads -lsarpc -lmqmcics_r -lmqmxa_r -lmqzi_r -lmqmcs_r
rm tmp.exp
Linux platforms
Issue the following command:
Windows
Follow these steps:
1. Use the cl command to build amqzscin.obj by compiling at least the following variables:
IBM MQ Scenarios 79
cl.exe -c -I EncinaPath\include -I MQ_INSTALLATION_PATH\include -Gz -LD amqzscin.c
2. Create a module definition file named mqmc1415.def, which contains the following lines:
LIBRARY MQMC4SWI
EXPORTS
CICS_XA_Init
3. Use the lib command to build an export file and an import library by using at least the following
option:
For extended transactional clients, use the switch load file mqcc4swi.dll.
Here is an example of adding an XAD stanza entry for IBM MQ for AIX or Linux systems, where
MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed:
80 IBM MQ Scenarios
For extended transactional clients, use the switch load file amqczsc.
See the CICS documentation for information about using the cicsadd command.
Calls to IBM MQ can be included in a CICS transaction, and the IBM MQ resources will be committed or
rolled back as directed by CICS. This support is not available to client applications.
You must issue an MQCONN from your CICS transaction in order to access IBM MQ resources, followed by a
corresponding MQDISC on exit.
IBM MQ Scenarios 81
COM+ divides work up into activities, which are typically short independent chunks of business logic, such
as transfer funds from account A to account B. COM+ relies heavily on object orientation and in particular
on COM; loosely a COM+ activity is represented by a COM (business) object.
COM+ is an integrated part of the operating system.
COM+ provides three services to the business object administrator, removing much of the worry from the
business object programmer:
• Transaction management
• Security
• Resource pooling
You usually use COM+ with front-end code that is a COM client to the objects held within COM+, and
back-end services such as a database, with IBM MQ bridging between the COM+ business object and the
back-end.
The front-end code can be a stand-alone program, or an Active Server Page (ASP) hosted by the Microsoft
Internet Information Server (IIS). The frontend code can be on the same computer as COM+ and its
business objects, with connection through COM. Alternatively, the frontend code can be on a different
computer, with connection through DCOM. You can use different clients to access the same COM+
business object in different situations.
The backend code can be on the same computer as COM+ and its business objects, or on a different
computer with connection through any of the IBM MQ supported protocols.
82 IBM MQ Scenarios
Unit of recovery disposition
The unit of recovery disposition is related to an application's connection and subsequently any
transactions that it starts. There are two possible unit of recovery dispositions.
• A GROUP unit of recovery disposition identifies that a transactional application is logically
connected to the queue sharing group and does not have an affinity to any specific queue manager.
Any 2-phase commit transactions that it starts that have completed phase-1 of the commit process,
that is, they are in doubt, can be inquired and resolved, when connected to any queue manager
within the QSG. In a recovery scenario this means that the transaction coordinator does not have to
reconnect to the same queue manager, which might be unavailable.
• A QMGR unit of recovery disposition identifies that an application has a direct affinity to the queue
manager to which it is connected and any transactions that it starts also have this disposition.
In a recovery scenario the transaction coordinator must reconnect to the same queue manager to
inquire, and resolve, any in-doubt transactions, irrespective of whether the queue manager belongs
to a queue sharing group.
For details of how to implement this feature, see Unit of recovery disposition in a queue
sharing group.
Security scenarios
A set of scenarios that demonstrate applying security to different configurations.
The available security scenarios are described in the following subtopics:
Related tasks
Setting up security on z/OS
IBM MQ Scenarios 83
Figure 13. Example security scenario
84 IBM MQ Scenarios
• Topic security off
• Connection security on
• Command security on
• Command resource security on
The following profiles are defined in the MQADMIN class to turn off process, namelist and topicsecurity:
QM1.NO.PROCESS.CHECKS
QM1.NO.NLIST.CHECKS
QM1.NO.TOPIC.CHECKS
QM2.NO.PROCESS.CHECKS
QM2.NO.NLIST.CHECKS
QM2.NO.TOPIC.CHECKS
IBM MQ Scenarios 85
QM1.TO.QM2.LU62
A sender channel definition, with the following attributes:
• CHLTYPE(SDR)
• TRPTYPE(LU62)
• XMITQ(QM1.TO.QM2.LU62)
• CONNAME(QM2LU62)
(See Security considerations for the channel initiator on z/OS for information about setting up APPC
security.)
QM1.TO.QM2.TLS
A sender channel definition, with the following attributes:
• CHLTYPE(SDR)
• TRPTYPE(TCP)
• XMITQ(QM1.TO.QM2.TLS)
• CONNAME(QM2TCP)
• SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)
86 IBM MQ Scenarios
• TRPTYPE(TCP)
• PUTAUT(CTX)
• MCAUSER(MCASSL)
• SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256)
Security profiles and accesses required for the two queue manager scenario
Information about the security profiles and accesses required for either a batch or CICS implementation
of the two queue manager scenario.
The following table shows the security profiles that are required to enable the two queue manager
scenario to work. Additional security profiles are also needed, depending on whether you are doing a
batch or a CICS implementation of the scenario. For further information see “Security profiles required for
a batch application” on page 88 and “Security profiles required for a CICS application” on page 90.
IBM MQ Scenarios 87
Table 10. Security profiles for the example scenario.
The four columns in this table show the class, the profile, the user ID, and access for the two queue
manager scenario.
(continued)
Class Profile User ID Access
MQQUEUE QM1.SYSTEM.CHANNEL.SYNCQ MOVER1 UPDATE
MQQUEUE QM1.SYSTEM.CHANNEL.INITQ MOVER1 UPDATE
MQQUEUE QM1.SYSTEM.COMMAND.REPLY.MODEL MOVER1 UPDATE
MQQUEUE QM1.SYSTEM.ADMIN.CHANNEL.EVENT MOVER1 UPDATE
MQQUEUE QM1.QM1.TO.QM2.TCP MOVER1 ALTER
MQQUEUE QM1.QM1.TO.QM2.LU62 MOVER1 ALTER
MQQUEUE QM1.QM1.TO.QM2.TLS MOVER1 ALTER
MQCONN QM2.CHIN MOVER2 READ
MQADMIN QM2.RESLEVEL MOVER2 NONE
MQADMIN QM2.CONTEXT.** MOVER2 CONTROL
MQQUEUE QM2.SYSTEM.COMMAND.INPUT MOVER2 UPDATE
MQQUEUE QM2.SYSTEM.CHANNEL.SYNCQ MOVER2 UPDATE
MQQUEUE QM2.SYSTEM.CHANNEL.INITQ MOVER2 UPDATE
MQQUEUE QM2.SYSTEM.COMMAND.REPLY.MODEL MOVER2 UPDATE
MQQUEUE QM2.SYSTEM.ADMIN.CHANNEL.EVENT MOVER2 UPDATE
MQQUEUE QM2.DLQ MOVER2 UPDATE
Table 11. Sample security profiles for the batch application on queue manager QM1
Class Profile User ID Access
MQCONN QM1.BATCH BATCHID READ
MQADMIN QM1.CONTEXT.** BATCHID CONTROL
MQQUEUE QM1.LQ1 BATCHID UPDATE
MQQUEUE QM1.RQA BATCHID UPDATE
88 IBM MQ Scenarios
Table 11. Sample security profiles for the batch application on queue manager QM1 (continued)
Class Profile User ID Access
MQQUEUE QM1.RQB BATCHID UPDATE
MQQUEUE QM1.RQC BATCHID UPDATE
The following profiles are required on queue manager QM2 for messages put to queue RQA on queue
manager QM1 (for the TCP/IP channel not using TLS):
Table 12. Sample security profiles for queue manager QM2 using TCP/IP and not TLS
Class Profile User ID Access
MQADMIN QM2.ALTERNATE.USER.MSGUSR MCATCP MOVER2 UPDATE
MQADMIN QM2.CONTEXT.** MCATCP MOVER2 CONTROL
MQQUEUE QM2.LQA MOVER2 MSGUSR UPDATE
MQQUEUE QM2.DLQ MOVER2 MSGUSR UPDATE
Notes:
1. The user ID passed in the MQMD of the message is used as the user ID for the MQPUT1 on queue
manager QM2 because the receiver channel was defined with PUTAUT(CTX) and MCAUSER(MCATCP).
2. The MCAUSER field of the receiver channel definition is set to MCATCP; this user ID is used in addition
to the channel initiator address space user ID for the checks carried out against the alternate user ID
and context profile.
3. The MOVER2 user ID and the UserIdentifier in the message descriptor (MQMD) are used for the
resource checks against the queue.
4. The MOVER2 and MSGUSR user IDs both need access to the dead-letter queue so that messages that
cannot be put to the destination queue can be sent there.
5. Two user IDs are checked on all three checks performed because RESLEVEL is set to NONE.
The following profiles are required on queue manager QM2 for messages put to queue RQB on queue
manager QM1 (for the LU 6.2 channel):
Table 13. Sample security profiles for queue manager QM2 using LU 6.2
Class Profile User ID Access
MQADMIN QM2.ALTERNATE.USER.MSGUSR MCALU62 UPDATE
MOVER1
MQADMIN QM2.CONTEXT.** MCALU62 CONTROL
MOVER1
MQQUEUE QM2.LQB MOVER1 MSGUSR UPDATE
MQQUEUE QM2.DLQ MOVER1 MSGUSR UPDATE
Notes:
1. The user ID passed in the MQMD of the message is used as the user ID for the MQPUT1 on queue
manager QM2 because the receiver channel was defined with PUTAUT(CTX) and MCAUSER(MCALU62).
2. The MCA user ID is set to the value of the MCAUSER field of the receiver channel definition (MCALU62).
3. Because LU 6.2 supports security on the communications system for the channel, the user ID received
from the network is used as the channel user ID (MOVER1).
4. Two user IDs are checked on all three checks performed because RESLEVEL is set to NONE.
IBM MQ Scenarios 89
5. MCALU62 and MOVER1 are used for the checks performed against the alternate user ID and Context
profiles, and MSGUSR and MOVER1 are used for the checks against the queue profile.
6. The MOVER1 and MSGUSR user IDs both need access to the dead-letter queue so that messages that
cannot be put to the destination queue can be sent there.
The following profiles are required on queue manager QM2 for messages put to queue RQC on queue
manager QM1 (for the TCP/IP channel using TLS):
Table 14. Sample security profiles for queue manager QM2 using TCP/IP and TLS
Class Profile User ID Access
MQADMIN QM2.ALTERNATE.USER.MSGUSR MCASSL CERTID UPDATE
MQADMIN QM2.CONTEXT.** MCASSL CERTID CONTROL
MQQUEUE QM2.LQC CERTID MSGUSR UPDATE
MQQUEUE QM2.DLQ CERTID UPDATE
MSGUSR
Notes:
1. The user ID passed in the MQMD of the message is used as the user ID for the MQPUT1 on queue
manager QM2 because the receiver channel was defined with PUTAUT(CTX) and MCAUSER(MCASSL).
2. The MCA user ID is set to the value of the MCAUSER field of the receiver channel definition (MCASSL).
3. Because the certificate flowed by the channel from QM1 as part of the TLS handshake might be
installed on QM2's system, or might match a certificate name filter on QM2's system, the user ID found
during that matching is used as the channel user ID (CERTID).
4. Two user IDs are checked on all three checks performed because RESLEVEL is set to NONE.
5. MCASSL and CERTID are used for the checks performed against the alternate user ID and Context
profiles, and MSGUSR and MOVER1 are used for the checks against the queue profile.
6. The CERTID and MSGUSR user IDs both need access to the dead-letter queue so that messages that
cannot be put to the destination queue can be sent there.
Table 15. Sample security profiles for the CICS application on queue manager QM1
Class Profile User ID Access
MQCONN QM1.CICS CICSAD1 READ
MQADMIN QM1.CONTEXT.** CICSAD1 CICSTX1 CONTROL
MQQUEUE QM1.LQ1 CICSAD1 CICSTX1 UPDATE
MQQUEUE QM1.RQA CICSAD1 CICSTX1 UPDATE
MQQUEUE QM1.RQB CICSAD1 CICSTX1 UPDATE
90 IBM MQ Scenarios
Security scenario: queue sharing group on z/OS
In this scenario, an application uses the MQPUT1 call to put messages to queues on queue manager
QM1. Some of the messages are then forwarded to queues on QM2, using TCP and LU 6.2 channels.
The application is a batch application, and the messages are put using the MQPMO_SET_ALL_CONTEXT
option.
This is illustrated in Figure 13 on page 84.
The following assumptions are made about the queue managers:
• All the required IBM MQ definitions have been predefined or have been made through the CSQINP2
data set processed at queue manager startup.
If they have not, you need the appropriate access authority to the commands needed to define these
objects.
• All the RACF profiles required have been defined and appropriate access authorities have been granted,
before the queue manager and channel initiators started.
If they have not, you need the appropriate authority to issue the RACF commands required to define
all the profiles needed and grant the appropriate access authorities to those profiles. You also need the
appropriate authority to issue the MQSC security commands to start using the new security profiles.
Related tasks
Setting up security on z/OS
QSGA.NO.PROCESS.CHECKS
QSGA.NO.NLIST.CHECKS
QSGA.NO.TOPIC.CHECKS
QSGA.NO.QMGR.CHECKS
IBM MQ Scenarios 91
Queue manager QM1 in queue sharing group scenario
Queues and channels for QM1.
The following queues are defined on queue manager QM1:
LQ1
A local queue.
RQA
A remote queue definition, with the following attributes:
• RNAME(LQA)
• RQMNAME(QM2)
• XMITQ(QM1.TO.QM2.TCP)
RQB
A remote queue definition, with the following attributes:
• RNAME(LQB)
• RQMNAME(QM2)
• XMITQ(QM1.TO.QM2.LU62)
QM1.TO.QM2.TCP
A transmission queue.
QM1.TO.QM2.LU62
A transmission queue.
The following channels are defined on QM1:
QM1.TO.QM2.TCP
A sender channel definition, with the following attributes:
• CHLTYPE(SDR)
• TRPTYPE(TCP)
• XMITQ(QM1.TO.QM2.TCP)
• CONNAME(QM2TCP)
QM1.TO.QM2.LU62
A sender channel definition, with the following attributes:
• CHLTYPE(SDR)
• TRPTYPE(LU62)
• XMITQ(QM1.TO.QM2.LU62)
• CONNAME(QM2LU62)
(See Security considerations for the channel initiator on z/OS for information about setting up APPC
security.)
92 IBM MQ Scenarios
The following channels have been defined on QM2:
QM1.TO.QM2.TCP
A receiver channel definition, with the following attributes:
• CHLTYPE(RCVR)
• TRPTYPE(TCP)
• PUTAUT(CTX)
• MCAUSER(MCATCP)
QM1.TO.QM2.LU62
A receiver channel definition, with the following attributes:
• CHLTYPE(RCVR)
• TRPTYPE(LU62)
• PUTAUT(CTX)
• MCAUSER(MCALU62)
(See Security considerations for the channel initiator on z/OS for information about setting up APPC
security.)
Security profiles and accesses required for queue sharing group scenario
Security profiles and accesses for either a batch or CICS implementation of the queue sharing group
scenario.
The following table shows the security profiles that are required to enable the queue sharing group
scenario to work. A batch implementation of this scenario also requires the additional security profiles
that are described in “Security profiles required for a batch application” on page 94.
IBM MQ Scenarios 93
Table 16. Security profiles for the example scenario.
The four columns in this table show the class, the profile, the user ID, and access for the queue sharing
group scenario.
(continued)
Class Profile User ID Access
MQADMIN QSGA.RESLEVEL BATCHID NONE
MOVER1
MOVER2
MQADMIN QSGA.CONTEXT.** MOVER1 CONTROL
MOVER2
MQQUEUE QSGA.SYSTEM.COMMAND.INPUT MOVER1 UPDATE
MOVER2
MQQUEUE QSGA.SYSTEM.CHANNEL.SYNCQ MOVER1 UPDATE
MOVER
MQQUEUE QSGA.SYSTEM.CHANNEL.INITQ MOVER1 UPDATE
MOVER2
MQQUEUE QSGA.SYSTEM.COMMAND.REPLY.MODEL MOVER1 UPDATE
MOVER2
MQQUEUE QSGA.SYSTEM.ADMIN.CHANNEL.EVENT MOVER1 UPDATE
MOVER2
MQQUEUE QSGA.SYSTEM.QSG.CHANNEL.SYNCQ MOVER1 UPDATE
MOVER2
MQQUEUE QSGA.SYSTEM.QSG.TRANSMIT.QUEUE MOVER1 UPDATE
MOVER2
MQQUEUE QSGA.QM1.TO.QM2.TCP MOVER1 ALTER
MQQUEUE QSGA.QM1.TO.QM2.LU62 MOVER1 ALTER
MQQUEUE QSGA.DLQ MOVER2 UPDATE
Table 17. Sample security profiles for the batch application on queue manager QM1
Class Profile User ID Access
MQCONN QSGA.BATCH BATCHID READ
MQADMIN QSGA.CONTEXT.** BATCHID CONTROL
94 IBM MQ Scenarios
Table 17. Sample security profiles for the batch application on queue manager QM1 (continued)
Class Profile User ID Access
MQQUEUE QSGA.LQ1 BATCHID UPDATE
MQQUEUE QSGA.RQA BATCHID UPDATE
MQQUEUE QSGA.RQB BATCHID UPDATE
The following profiles are required on queue manager QM2 for messages put to queue RQA on queue
manager QM1 (for the TCP/IP channel):
Table 18. Sample security profiles for queue manager QM2 using TCP/IP
Class Profile User ID Access
MQADMIN QSGA.ALTERNATE.USER.MSGUSR MCATCP MOVER2 UPDATE
MQADMIN QSGA.CONTEXT.** MCATCP MOVER2 CONTROL
MQQUEUE QSGA.LQA MOVER2 UPDATE
MSGUSR
MQQUEUE QSGA.DLQ MOVER2 UPDATE
MSGUSR
Notes:
1. The user ID passed in the MQMD of the message is used as the user ID for the MQPUT1 on queue
manager QM2 because the receiver channel was defined with PUTAUT(CTX) and MCAUSER(MCATCP).
2. The MCAUSER field of the receiver channel definition is set to MCATCP; this user ID is used in addition
to the channel initiator address space user ID for the checks carried out against the alternate user ID
and context profile.
3. The MOVER2 user ID and the UserIdentifier in the message descriptor (MQMD) are used for the
resource checks against the queue.
4. The MOVER2 and MSGUSR user IDs both need access to the dead-letter queue so that messages that
cannot be put to the destination queue can be sent there.
5. Two user IDs are checked on all three checks performed because RESLEVEL is set to NONE.
The following profiles are required on queue manager QM2 for messages put to queue RQB on queue
manager QM1 (for the LU 6.2 channel):
Table 19. Sample security profiles for queue manager QM2 using LU 6.2
Class Profile User ID Access
MQADMIN QSGA.ALTERNATE.USER.MSGUSR MCALU62 UPDATE
MOVER1
MQADMIN QSGA.CONTEXT.** MCALU62 CONTROL
MOVER1
MQQUEUE QSGA.LQB MOVER1 UPDATE
MSGUSR
MQQUEUE QSGA.DLQ MOVER1 UPDATE
MSGUSR
Notes:
1. The user ID passed in the MQMD of the message is used as the user ID for the MQPUT1 on queue
manager QM2 because the receiver channel was defined with PUTAUT(CTX) and MCAUSER(MCALU62).
IBM MQ Scenarios 95
2. The MCA user ID is set to the value of the MCAUSER field of the receiver channel definition (MCALU62).
3. Because LU 6.2 supports security on the communications system for the channel, the user ID received
from the network is used as the channel user ID (MOVER1).
4. Two user IDs are checked on all three checks performed because RESLEVEL is set to NONE.
5. MCALU62 and MOVER1 are used for the checks performed against the alternate user ID and Context
profiles, and MSGUSR and MOVER1 are used for the checks against the queue profile.
6. The MOVER1 and MSGUSR user IDs both need access to the dead-letter queue so that messages that
cannot be put to the destination queue can be sent there.
Inbound channel
The following example shows a typical configuration for an inbound channel of type receiver, and provides
details of the AMS policy required to protect unprotected inbound messages:
Note: The policy described in the preceding text encrypts messages only; that is, AMS Confidentiality.
See setmqspl and the message security policy (CSQ0UTIL) for information on using setmqspl on z/OS.
Outbound channel
The following example shows a typical configuration for an outbound channel of type sender. The example
provides details of the AMS policies required to protect messages put to the remote queue, and to
unprotect and send messages got from the transmission queue:
96 IBM MQ Scenarios
Figure 15. Outbound configuration
Note: The policy described in the preceding text encrypts messages only; that is, AMS Confidentiality.
IBM MQ Scenarios 97
2. When a z/OS queue manager is acting in the role of an SSL/TLS client, the queue
manager sends only a certificate.
The SSL/TLS client sends a certificate only if it can find a certificate with a matching label. See Digital
certificate labels for details.
The SSL/TLS server always validates the client certificate if one is sent. If the client does not send a
certificate, authentication fails only if the end of the channel that is acting as the SSL/TLS server is defined
with either the SSLCAUTH parameter set to REQUIRED or an SSLPEER parameter has a value set. For
more information about connecting a queue manager anonymously, that is, when the SSL/TLS client does
not send a certificate, see “Connecting two queue managers using one-way authentication” on page 103.
In Figure 16 on page 98, the key repository for QM1 contains the certificate for QM1 and the public
certificate from QM2. The key repository for QM2 contains the certificate for QM2 and the public
certificate from QM1.
Procedure
1. Prepare the key repository on each queue manager, according to operating system:
• On z/OS systems.
2. Create a self-signed certificate for each queue manager:
• On z/OS systems.
98 IBM MQ Scenarios
3. Extract a copy of each certificate:
• On z/OS systems.
4. Transfer the public part of the QM1 certificate to the QM2 system and vice versa, using a utility such as
FTP , as described in Exchanging self-signed certificates .
5. Add the partner certificate to the key repository for each queue manager:
• On z/OS systems.
6. On QM1, define a sender channel and associated transmission queue, by issuing commands like the
following example:
This example uses CipherSpec TLS_RSA. The CipherSpecs at each end of the channel must be the
same.
7. On QM2, define a receiver channel, by issuing a command like the following example:
The channel must have the same name as the sender channel you defined in Step “6” on page 99, and
use the same CipherSpec.
8. Start the channel.
Results
Key repositories and channels are created as illustrated in Figure 16 on page 98
What to do next
Check that the task has been completed successfully by using DISPLAY commands. If the task was
successful, the resulting output is similar to that shown in the following examples.
From queue manager QM1, enter the following command:
SSLPEER("SERIALNUMBER=4C:D0:49:D5:02:5E:02,CN=QM2,OU=<Department>,O=<Organization>,ST=<State>,C=
<Country>")
STATUS(RUNNING) SUBSTATE(MQGET)
XMITQ(QM2)
IBM MQ Scenarios 99
From queue manager QM2, enter the following command:
SSLPEER("SERIALNUMBER=4C:D0:49:D5:02:5F:38,CN=QM1,OU=<Department>,O=<Organization>,ST=<State>,C=
<Country>")
STATUS(RUNNING) SUBSTATE(RECEIVE)
XMITQ( )
In each case, the value of SSLPEER must match that of the DN in the partner certificate that was created
in Step “2” on page 98. The issuers name matches the peer name because the certificate is self-signed .
SSLPEER is optional. If it is specified, its value must be set so that the DN in the partner certificate
(created in Step “2” on page 98) is allowed. For more information about the use of SSLPEER, see IBM MQ
rules for SSLPEER values.
In Figure 17 on page 100, the key repository for QM1 contains QM1's certificate and the CA certificate.
The key repository for QM2 contains QM2's certificate and the CA certificate.
Procedure
1. Prepare the key repository on each queue manager, according to the operating system, or systems,
your enterprise uses:
• On IBM i systems.
• On z/OS systems.
2. Request a CA-signed certificate for each queue manager.
You might use different CAs for the two queue managers.
• On IBM i systems.
• On z/OS systems.
3. Add the Certificate Authority certificate to the key repository for each queue manager:
If the Queue managers are using different Certificate Authorities then the CA certificate for each
Certificate Authority must be added to both key repositories.
• On z/OS systems.
4. Receive the CA-signed certificate to the key repository for each queue manager:
• On IBM i systems.
• On z/OS systems.
5. On QM1, define a sender channel and associated transmission queue by issuing commands like the
following example:
The channel must have the same name as the sender channel you defined in Step “5” on page 101,
and use the same CipherSpec.
7. Start the channel:
• On z/OS systems.
Results
Key repositories and channels are created as illustrated in Figure 17 on page 100.
What to do next
Check that the task has been completed successfully by using DISPLAY commands. If the task was
successful, the resulting output is like that shown in the following examples.
From queue manager QM1, enter the following command:
SSLPEER("SERIALNUMBER=4C:D0:49:D5:02:5F:38,CN=QM2,OU=<Department>,O=<Organization>,ST=<State>,C=
<Country>")
STATUS(RUNNING) SUBSTATE(MQGET)
XMITQ(QM2)
SSLPEER("SERIALNUMBER=4C:D0:49:D5:02:5F:38,CN=QM1,OU=<Department>,O=<Organization>,ST=<State>,C=
<Country>")
STATUS(RUNNING) SUBSTATE(RECEIVE)
XMITQ( )
In each case, the value of SSLPEER must match that of the Distinguished Name (DN) in the partner
certificate that was created in Step “2” on page 101. The issuer name matches the subject DN of the CA
certificate that signed the personal certificate added in Step “4” on page 101.
Procedure
1. Remove the personal certificate of QM1 from its key repository:
• Removing a certificate on z/OS systems. Perform this step twice, to remove both the
personal certificate for QMA, and the default certificate.
For details of how certificates are labeled, see Digital certificate labels.
2. Optional: On QM1, if any SSL/TLS channels have run previously, refresh the SSL/TLS environment , as
described in Refreshing the TLS environment .
3. Allow anonymous connections on the receiver , as described in Allowing anonymous connections on a
receiver channel .
Key repositories and channels are changed as illustrated in Figure 18 on page 103
4. If the sender channel was not running, start it.
Note: If the sender channel was running and you issued the REFRESH SECURITY TYPE(SSL) command
(in step 2), the channel restarts automatically.
At the server end of the channel, the presence of the peer name parameter value on the channel status
display indicates that a client certificate has flowed.
5. Verify that the task has been completed successfully by issuing some DISPLAY commands.
If the task was successful, the resulting output is similar to that shown in the following examples:
• From the QM1 queue manager, enter the following command:
On QM2, the SSLPEER field is empty, showing that QM1 did not send a certificate. On QM1, the value
of SSLPEER matches that of the DN in QM2's personal certificate.
On IBM i, AIX, Linux, and Windows systems, the SSL/TLS client sends a
certificate only if it has one labeled in the correct IBM MQ format, which is either ibmwebspheremq
followed by your logon user ID in lowercase, or the value of the CERTLABL attribute. See Digital certificate
labels.
In Figure 19 on page 105, the key repository for QM1 contains the certificate for QM1 and the public
certificate from C1. The key repository for C1 contains the certificate for C1 and the public certificate from
QM1.
Procedure
1. Prepare the key repository on the client and queue manager, according to operating system:
• On z/OS systems.
4. Transfer the public part of the C1 certificate to the QM1 system and vice versa, using a utility such as
FTP.
• On z/OS systems.
6. Issue the command REFRESH SECURITY TYPE(SSL) on the queue manager.
7. Define a client-connection channel in either of the following ways:
• Using the MQCONNX call with the MQSCO structure on C1, as described in Creating a client-
connection channel on the IBM MQ MQI client.
• Using a client channel definition table, as described in Creating server-connection and client-
connection definitions on the server.
8. On QM1, define a server-connection channel, by issuing a command like the following example:
The channel must have the same name as the client-connection channel you defined in step 6, and use
the same CipherSpec.
Results
Key repositories and channels are created as illustrated in Figure 19 on page 105.
What to do next
Check that the task has been completed successfully by using DISPLAY commands. If the task was
successful, the resulting output is similar to that shown in the following example.
From queue manager QM1, enter the following command:
It is optional to set the SSLPEER filter attribute of the channel definitions. If the channel definition
SSLPEER is set, its value must match the subject DN in the partner certificate that was created in Step
In Figure 20 on page 107, the key repository for C1 contains certificate for C1 and the CA certificate.
The key repository for QM1 contains the certificate for QM1 and the CA certificate. In this example both
C1's certificate and QM1's certificate were issued by the same CA. If C1's certificate and QM1's certificate
were issued by different CAs then the key repositories for C1 and QM1 must contain both CA certificates.
Procedure
1. Prepare the key repository on the client and queue manager, according to operating system:
• On IBM i systems.
• On IBM i systems.
• On IBM i systems.
The channel must have the same name as the client-connection channel you defined in step 6, and use
the same CipherSpec.
Results
Key repositories and channels are created as illustrated in Figure 20 on page 107.
What to do next
Check that the task has been completed successfully by using DISPLAY commands. If the task was
successful, the resulting output is like that shown in the following example.
From the queue manager QM1, enter the following command:
The SSLPEER field in the DISPLAY CHSTATUS output shows the subject DN of the remote client certificate
that was created in Step 2. The issuer name matches the subject DN of the CA certificate that signed the
personal certificate added in Step 4.
Procedure
1. Remove the personal certificate from the key repository for C1, according to operating system:
• IBM i systems.
Results
Key repositories and channels are changed as illustrated in Figure 21 on page 109
What to do next
At the server end of the channel, the presence of the peer name parameter value on the channel status
display indicates that a client certificate has flowed.
Verify that the task has been completed successfully by issuing some DISPLAY commands. If the task was
successful, the resulting output is similar to that shown in the following example:
From queue manager QM1, enter the following command:
The SSLCERTI and SSLPEER fields are empty, showing that C1 did not send a certificate.
Migrating on Windows
Starting with an existing IBM MQ 9.1 installation, this scenario leads you through the key tasks required to
upgrade and migrate data to IBM MQ 9.2. Both versions are installed on the same Windows environment.
Assumptions
This scenario makes several assumptions about the system that you are using to set up and work with
the sample IT configuration. These assumptions include the operating system and version of the products
that you are using, and whether or not you have security configured for IBM MQ.
This scenario assumes the following points:
• You are using one computer with a Windows operating system for this scenario, on which you will install
both the initial IBM MQ 9.1 configuration and then IBM MQ 9.2.
Note: Clustering is not described in this scenario. Instructions are provided for installing a sample IBM
MQ single server configuration which you can use as a starting point for trying out the scenario in the
same way as it was originally developed.
• You are using the following versions of IBM MQ:
– For the initial sample configuration, you are using IBM MQ 9.1.
– For the post-migration configuration, you are using IBM MQ 9.2.
• This scenario does not describe the security configuration for IBM MQ. If you do have security
configured you should still be able to complete the scenario.
• You can use the Windows command prompt, and the graphical user interface IBM MQ Explorer, to
complete the tasks described in this scenario.
Related concepts
Migration paths
Business overview
A company wants to migrate the existing IBM MQ 9.1 IT configuration on a Windows operating system, to
IBM MQ 9.2.
The company decides to migrate their business solution to IBM MQ 9.2 to gain business value including:
• Using new and updated functionality available in IBM MQ 9.2.
Technical solution
This scenario describes two methods of migrating from an earlier version of IBM MQ to a later version,
where both versions run on a Windows operating system and are on the same server.
Procedure
1. Create a sample initial IT configuration to use as a starting point for the scenario as described in
“Creating an initial IT configuration” on page 116.
2. Select the method that you are going to use to migrate the product then follow the instructions for your
chosen option:
• “Option 1: Single-stage migration” on page 125
• “Option 2: Side-by-side migration” on page 131
Related concepts
AIX, Linux, and Windows: Single-stage migration from IBM WebSphere MQ 7.0.1, or later, to the latest
version
AIX, Linux, and Windows: Side-by-side migration from IBM WebSphere MQ 7.0.1, or later, to the latest
version
Related tasks
Migrating a queue manager from a previous version to the latest version on Windows
Choosing a primary installation
Procedure
1. Install IBM MQ 9.1 and verify your installation.
2. Configure the JNDI namespace and administered objects.
3. Verify the sample IT configuration.
Procedure
1. You can start the installation process in one of two ways:
Results
IBM MQ is installed on your computer.
What to do next
You are ready to create the administered objects used in this scenario as described in “Configuring the
JNDI namespace and administered objects” on page 118.
Related concepts
Introduction to IBM MQ
Related tasks
Installing an IBM MQ server on Windows
Configuring an IBM MQ server
Related reference
Hardware and software requirements on Windows systems
Results
You have now created the IBM MQ objects that are required to use the sample JMS application.
What to do next
You are now ready to verify that you have configured IBM MQ correctly for use with the sample application
as described in “Verifying the sample IT configuration” on page 123.
Procedure
1. Double-click the runresponder.cmd file.
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to
QueueManager.> Created connection.
> Waiting for message.
Results
In the command prompt window, labeled Requester window, the requester client shows the connection
status, the message it sent, then the reply message that it received from the responder client:
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to
QueueManager.> Connection created.
> Sending stock request for 'BakedBeans'> Sent Message
ID=ID:414d5120514d5f4c33344c3238482020c3cd094d20002b02
> Received Message ID=ID:414d5120514d5f4c33344c3238482020c3cd094d20002902 for 'B
akedBeans - 15 tins in stock'
> Closing connection to QueueManager.> Closed Connection.
--------------------------------------------------------
In this window, observe the messages sent through IBM MQ:
- The request message sent
- The reply message received
-----
When ready, press any key to close this window
Press any key to continue . . .
In the Responder window, observe the updated responder messages; the message it received (from the
requester client) and the reply message that it sent:
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to
QueueManager.> Created connection.
> Waiting for message.
The messages shown in the two command windows verify that the requester and responder clients of the
sample application can communicate with each other through IBM MQ.
What to do next
You are now ready to start migrating your sample IBM MQ 9.1 installation to a later release of IBM MQ
using one of the following two migration options:
• To migrate using the single-stage migration method, follow the instructions in “Option 1: Single-stage
migration” on page 125.
• To migrate using the side-by-side migration method, follow the instructions in “Option 2: Side-by-side
migration” on page 131.
Procedure
1. Stop the queue managers running in the earlier version of IBM MQ, and back up the queue manager
data.
2. Uninstall the earlier version of IBM MQ that you are migrating from, without removing the queue
manager data.
3. Install IBM MQ 9.2 using the launchpad..
4. Use IBM MQ Explorer to verify the new IBM MQ 9.2 installation.
Verify that the queue managers have been successfully migrated from the earlier release and that you
can put messages to and get messages from the migrated queues.
Related tasks
Migrating on AIX and Linux: single-stage
Preparing to migrate
Before migrating to a later version of IBM MQ, you must first stop the queue manager and back up the
queue manager data.
Procedure
1. Open IBM MQ Explorer.
Click Start > All Applications > IBM MQ > IBM MQ Explorer.
Results
You have stopped the queue manager that you are going to migrate to the later release of IBM MQ and
have taken a backup of the queue manager data.
What to do next
You are now ready to uninstall IBM MQ as described in “Uninstalling the earlier version” on page 126.
Related tasks
Backing up queue manager data
Procedure
1. Open the Windows Control Panel by clicking Start > Control Panel > Uninstall a program.
2. In the Programs and Features window, find the entry for the installation that you want to remove, for
example IBM WebSphere MQ (Installation1), and click Uninstall.
The uninstallation process begins and runs to completion. When the process completes, the earlier
version of IBM MQ is removed from your computer and is no longer displayed in the list of programs.
Results
The earlier version of IBM MQ has been removed from your computer. However the queue manager data
has not been removed.
What to do next
You are now ready to install the later version of IBM MQ as described in “Installing IBM MQ 9.2 using the
launchpad” on page 127.
Related tasks
Uninstalling IBM MQ on Windows systems
This task assumes that you have previously uninstalled the earlier version of IBM MQ from which you are
migrating as described in “Uninstalling the earlier version” on page 126. If you install the later version
without first uninstalling the earlier version, some of the options and messages that you see during the
installation process will be different from those described in this task.
Before starting this task, complete the following checks:
• You must have local administrator authority when you are installing. Define this authority through the
Windows facilities.
• Ensure that the machine name does not contain any spaces.
Procedure
1. You can start the installation process in one of two ways:
• In Windows Explorer, navigate to the temporary folder into which you downloaded the installation
image and double-click setup.exe, or
• Insert the IBM MQ for Windows Server DVD into the DVD drive. If autorun is enabled, the installation
process starts. Otherwise, double-click the Setup icon in the root folder of the DVD to start the
installation process.
The installation launchpad is started.
2. Start the Launchpad, review, and if necessary, modify the software requirements and network
configuration.
a) Navigate to the IBM MQ software directory, and double-click the file Setup.exe to start the
Launchpad.
b) Click the Software Requirements button to display the Software Requirements tab.
c) Check that the software requirements have been met and that the entry for the requirement
displays a green tick with the words OK . Make any indicated corrections.
Note:
For details of any requirement, click the check box to expand an information tab.
d) Click the Network Configuration button to display the Network Configuration tab.
e) Click the No radio button.
Note: This scenario assumes that you do not need to configure a domain user ID for IBM MQ.
For more information regarding configuring IBM MQ for Windows domain users, click the More
information button.
f) On the IBM MQ Installation tab of the Launchpad, select the installation language, and then click
Launch IBM MQ Installer to start the IBM MQ installation wizard.
Results
You have installed IBM MQ, and you have started IBM MQ Explorer.
What to do next
Now that you have installed the later version of IBM MQ, you are ready to check that the sample queue
managers have been successfully migrated and that you are able to put messages to and get messages
from the migrated queues as described in “Verifying your IBM MQ 9.2 installation” on page 130.
Related tasks
Installing an IBM MQ server on Windows
Procedure
1. If IBM MQ Explorer is not running, start it now.
Click Start > All Programs > IBM MQ > IBM MQ Explorer.
2. Verify that your queue managers have been successfully migrated to the later version of IBM MQ:
a) In the Navigator view, expand the Queue Managers folder.
b) Check that you can see the queue manager sampleQM in the Queue Managers folder.
c) Expand queue manager sampleQM, click the Queues folder, and check that you can see queue Q1
in the Content view.
3. If queue manager sampleQM is not already started, start it now.
a) In the Navigator view, expand the queue managers node.
b) Right-click queue manager sampleQM, then click Start.
4. Verify that you can put a message to queue Q1.
a) In the Navigator view, expand the Queue Managers folder.
b) Expand queue manager sampleQM, then click the Queues folder.
c) In the Content view, right-click queue Q1, then click Put Test Message.
The Put test message dialog opens.
d) In the Message data field, type some text, for example Hello queue!, then click Put message.
The Message data field is cleared and the message is put on the queue.
e) Click Close.
In the Content view, notice that the Current queue depth value of the queue is now 1. If the
Current queue depth column is not visible, you might need to scroll to the right of the Content view.
5. Verify that you can get the message from queue Q1.
a) In the Navigator view, expand the Queue Managers folder,
b) Expand queue manager sampleQM then click the Queues folder.
c) In the Content view, right-click queue Q1, then click Browse Messages.
The Message browser opens to show the list of the messages that are currently on the queue.
d) Double-click the last message to open the properties dialog.
On the Data page of the properties dialog, the Message data field displays the content of the
message in human-readable form.
6. Verify that you can run the sample application.
a) Double-click the runresponder.cmd file.
In the command prompt window, labeled Responder window, the responder client starts then
waits for a message.
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to
QueueManager.> Created connection.
> Waiting for message.
In the Responder window, observe the updated responder messages; the message it received (from
the requester client) and the reply message that it sent:
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to
QueueManager.> Created connection.
> Waiting for message.
The messages shown in the two command windows verify that the requester and responder clients of
the sample application can communicate with each other through IBM MQ.
Results
You have successfully migrated to the later version of IBM MQ.
Procedure
1. Install IBM MQ 9.2 using the launchpad and then verify the installation..
2. Stop the queue managers running in the earlier version of IBM MQ.
3. Uninstall the earlier version of IBM MQ.
4. Make IBM MQ 9.2 the primary installation.
5. Optional: Associate the queue managers with IBM MQ 9.2
6. Use IBM MQ Explorer to verify the IBM MQ 9.2 installation.
Check that the queue managers have been successfully migrated from the earlier release and that you
can put messages to and get messages from the migrated queues.
Related tasks
Migrating on Windows: side-by-side
What to do next
You have installed the later version of IBM MQ alongside the earlier version, but in a different installation
directory, and you have started IBM MQ Explorer.
Your are now ready to stop the queue managers running in the earlier version of IBM MQ as described in
“Stopping the queue manager” on page 134.
Procedure
1. Open IBM MQ Explorer.
Click Start > All Applications > IBM MQ > IBM MQ Explorer.
2. Stop queue manager sampleQM.
a) In the Navigator View, right-click the queue manager sampleQM.
b) Click Stop.
The End Queue Manager window opens.
c) Select Controlled, then click OK.
Selecting the Controlled option stops your queue manager in a controlled, orderly way. The
Immediate option, which forces the queue manager to stop, is typically used only if a controlled
stop fails to complete successfully.
The queue manager stops. In the IBM MQ, the icon next to queue manager sampleQM is changed to
include a red arrow that points downward.
3. Close IBM MQ Explorer.
What to do next
After stopping the queue managers, you are ready to associate them with your new installation of the
later version of IBM MQ as described in “Associating the queue managers with IBM MQ 9.2” on page 137.
Procedure
1. Open the Windows Control Panel by clicking Start > Control Panel > Uninstall a program.
2. In the Programs and Features window, find the entry for the installation that you want to remove, for
example IBM WebSphere MQ (Installation1), and click Uninstall.
The uninstallation process begins and runs to completion. When the process completes, the earlier
version of IBM MQ is removed from your computer and is no longer displayed in the list of programs.
Results
The earlier version of the product has been removed from your computer. However the queue manager
data has not been removed.
Procedure
1. Check the current primary installation by entering the dspmqinst command into the command
prompt.
The command prompt displays the details of any current installations. The current primary installation
has the following line Primary: Yes .
2. Use the setmqinst command to change the current primary installation.
In the command prompt, enter:
setmqinst -x -n Installation_Name
setmqinst -i -n V9_Installation
What to do next
You are ready to associate the migrated queue managers with the later version of IBM MQ as described in
“Associating the queue managers with IBM MQ 9.2” on page 137.
Procedure
1. Start IBM MQ Explorer.
Click Start > All Applications > IBM MQ > IBM MQ Explorer.
2. In the Navigator view, right-click the queue managers node and select Transfer Queue Managers.
3. Right-click then select the queue manager sampleQM, then click Transfer.
The setmqm command is invoked with the selected queue managers. If the transfer is successful, the
navigator tree updates to include the transferred queue managers. If there are any problems, a dialog
is shown with the error message from the command.
4. Start the queue manager sampleQM.
a) In the Navigator view, expand the queue managers node.
b) Right-click the name of the queue manager, then click Start.
Results
You have successfully associated the queue manager sampleQM with the later version of IBM MQ.
What to do next
Verify that the queue manager sampleQM has been successfully migrated by confirming that you can put
a message to and get a message from the queue as described in “Verifying the IBM MQ 9.2 installation”
on page 137.
Procedure
1. If IBM MQ Explorer is not running, start it now.
In the Responder window, observe the updated responder messages; the message it received (from
the requester client) and the reply message that it sent:
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to
QueueManager.> Created connection.
> Waiting for message.
The messages shown in the two command windows verify that the requester and responder clients of
the sample application can communicate with each other through IBM MQ.
Results
You have successfully migrated to the later version of IBM MQ.
What to do next
For more information about migrating and upgrading see Maintaining and migrating.
If you are using a Continuous Delivery ( CD) version of IBM MQ for the later version of the
product, you must uninstall the CD version you are using, for example, IBM MQ 9.1.1, before you install
Procedure
1. Login as an administrator.
IBM MQ 9.2 will be installed in the default directory C:\Program Files\IBM\MQ.
2. Go to the directory where the download file is located, for example, C:\downloads\mq9200.
3. Unzip the downloaded file.
The files are extracted into a new subdirectory called MQServer.
4. Switch to the new directory and issue the command setup.exe to start the installer.
a) Click on Software Requirements to check that your enterprise has the requisite software installed.
See Checking requirements on Windows for more information. In this scenario, the system has the
requisite requirements.
b) Click on Network Configuration.
In this scenario, the machine is not part of a Domain, so there is no need to indicate a domain user
and the answer to the question is No.
c) Click on IBM MQ Installation.
Results
You have successfully installed another version of IBM MQ for Windows alongside an existing version of
the product.
What to do next
You need to run the setmqenv command to use the commands on either version. See “Using the
setmqenv command to run with both versions of IBM MQ” on page 142 for details.
Procedure
1. Display the installation information using the dspmqinst command.
InstName: Installation1
InstDesc:
Identifier: 1
InstPath: C:\Program Files\IBM\WebSphere MQ
Version: 8.0.0.9
Primary: Yes
State: Available
MSIProdCode: {74F6B169-7CE6-4EFB-8A03-2AA7B2DBB57C}
MSIMedia: 8.0 Server
MSIInstanceId: 1
InstName: Installation2
InstDesc:
Identifier: 2
InstPath: C:\Program Files\IBM\MQ
Version: 9.1.0.0
Primary: No
State: Available
MSIProdCode: {5D3ECA81-BF8D-4E80-B36C-CBB1D69BC110}
MSIMedia: 9.1 Server
MSIInstanceId: 1
C:\> dspmqver
Name: WebSphere MQ
Version: 8.0.0.9
Level: p800-009-180321.1
BuildType: IKAP - (Production)
Platform: WebSphere MQ for Windows (x64 platform)
Mode: 64-bit
O/S: Windows 10 Professional x64 Edition, Build 18363
InstName: Installation1
InstDesc:
Primary: Yes
InstPath: C:\Program Files\IBM\WebSphere MQ
DataPath: C:\ProgramData\IBM\MQ
MaxCmdLevel: 802
LicenseType: Production
4. To see the information about the IBM MQ 9.1 product issue the following command, C:\> setmqenv
-n Installation2.
5. Issue the command C:\> where dspmqver again and you see information about the second
installation:
C:\> dspmqver
Name: IBM MQ
Version: 9.1.0.0
Level: p910-L180705
BuildType: IKAP - (Production)
Platform: IBM MQ for Windows (x64 platform)
Mode: 64-bit
O/S: Windows 10 Professional x64 Edition, Build 18363
InstName: Installation2
InstDesc:
Primary: No
InstPath: C:\Program Files\IBM\MQ
DataPath: C:\ProgramData\IBM\MQ
MaxCmdLevel: 910
LicenseType: Production
7. Issue the command C:\ set MQ, and after using setmqenv you see information about the second
installation.
C:\> set MQ
MQ_DATA_PATH=C:\ProgramData\IBM\MQ
MQ_ENV_MODE=64
MQ_FILE_PATH=C:\Program Files\IBM\MQ
MQ_INSTALLATION_NAME=Installation2
MQ_INSTALLATION_PATH=C:\Program Files\IBM\MQ
MQ_JAVA_DATA_PATH=C:\ProgramData\IBM\MQ
MQ_JAVA_INSTALL_PATH=C:\Program Files\IBM\MQ\java
MQ_JAVA_LIB_PATH=C:\Program Files\IBM\MQ\java\lib64
MQ_JRE_PATH=C:\Program Files\IBM\MQ\java\jre
You can create a batch file that will run the setmqenv command with the specified syntax. Ensure you
have this batch file in a directory in your PATH, for example, C:\WinTools.
For example, you can create the batch file set-mq-910.bat with the contents:
Notes:
a. You need to use the "CALL" argument when invoking setmqenv. Without this argument, the
processing of setmqenv ends the batch and doesnot allow following statements to run. That is,
with the CALL argument, you allow other statements in the batch file to be processed.
b. If you add an IBM MQ directory into your PATH, such as the location for the C-
samples: PATH=…;C:\Program Files\IBM\MQ\tools\c\Samples\Bin;… this directory will
be REMOVED by setmqenv the next time the command runs.
Procedure
1. Select Start > Windows System > Command Prompt > More > Run as administrator
The title for the window created is Administrator: Command Prompt.
Note: The version of IBM MQ in the command prompt is IBM MQ 8.0.
2. Run the setmqenv command or the batch file you might have created, set-mq-920.
See “Using the setmqenv command to run with both versions of IBM MQ” on page 142 for details.
In either case, you see Version 9.2.0.0
3. Issue the following command, C:\> crtmqm -u SYSTEM.DEAD.LETTER.QUEUE QM910
You see the following output:
4. Issue the following command to start the queue manager C:\> strmqm QM920
You see the following output. Note the lines that indicate the installation and the version under which
the queue manager is running:
Important: You cannot use administrative commands on a different IBM MQ version from the one you
are on.
If you attempt to do so you receive message AMQ5691E: Queue manager <qmname> is
associated with a different installation (<installation name>).
Procedure
1. Take a backup of the queue manager using the dmpmqcfg command.
See Backing up and restoring IBM MQ queue manager data and Backing up queue manager
configurationfor more information.
a) To specify all the attributes, including default ones, (except setmqaut, which is not included in the
output, specify the following command:
Note: The output file containing the setmqaut commands, includes the name of the queue
manager in each command. Therefore, if you want to restore the commands into a different queue
manager, you need to edit the file and specify the desired queue manager name.
2. To restore the:
a) Commands for runmqsc, issue:
or
QMgr.dmpmqcfg.setmqaut.bat
3. The queue manager to be migrated is at IBM MQ 8.0, so you need to run the script that sets the
running environment to IBM MQ 8.0:
C:\> set-mq-80
a) Issue the command C:\> dspmqver to check the version that the queue manager is running on
IBM MQ 8.0.
b) Issue the command C:\> where dspmq to check that the queue manager is running:
4. Change the environment to run the IBM MQ 9.1 commands, either by issuing the command C:\>
set-mq-910 if you created the batch file, or by using the setmqenv command, and then check the
version by issuing the dspmqver command.
5. Display the status of the queue managers by issuing the command C:\> dspmq -o installation
-s.
You receive the following output:
QMNAME(QM80) STATUS(Running)INSTNAME(Installation1)
INSTPATH(C:\Program Files\IBM\WebSphere MQ) INSTVER(8.0.0.9)
Attention: Queue manager QMMIG is still associated with Installation1 ( IBM MQ 8.0)
while Installation2 is associated with IBM MQ 9.1.
Therefore, you need to disassociate the queue manager QMMIG from Installation1 and
associate it with Installation2
6. Issue the following command to associate queue manager QMMIG with Installation2
which informs you that QMMIG is now associated with IBM MQ 9.1.
7. Start queue manager QMMIG by issuing the command C:\> strmqm QMMIG
As this is the first time that the IBM MQ 9.1 strmqm command is being issued on a queue manager
that had prior use with an older version, a migration takes place.
You see output similar to the following:
8. Issue the following command, C:\> runmqsc QMMIG to display the attributes of the queue manager,
and note the VERSION and CMDLEVEL fields:
Results
You have successfully migrated a queue manager to a later version of the product.
Procedure
1. Login as an administrator.
a) Issue the command C:\> set-mq-920 if you created the batch file, or use the setmqenv
command, to make sure you are on IBM MQ 9.2.0.n, where n is 0 in this scenario.
b) Display the status of the queue managers by issuing the command C:\> dspmq -o
installation -s.
You receive the following output:
QMNAME(QM80) STATUS(Running)INSTNAME(Installation1)
INSTPATH(C:\Program Files\IBM\WebSphere MQ) INSTVER(9.0.0.9)
Results
You have successfully upgraded a version of IBM MQ for Windows alongside an existing version of the
product.
A base topology represents a complete configuration which includes the coordination queue manager.
The configuration name is the same as the name of the coordination queue manager. If the coordination
queue manager name is MFT1, the configuration name is MFT1.
The base topology is the first Managed File Transfer configuration that you complete. After the base
configuration is completed, partner agents from remote servers are added to the base configuration to
exchange files.
The base topology does not exchange files outside the base topology server. However, the base topology
enables you to move files to different locations in the same server and could be used for development
purposes.
This topology can exchange files between the two agents. Extra partner agents can be added in a similar
way to the first added agent.
You can use a single queue manager for all three Managed File Transfer queue manager roles, or you can
use dedicated queue managers for specific roles.
For example, you could have one queue manager dedicated to the coordination queue manager role, and
the command and agent roles might share a second queue manager.
The connection between a remote agent queue manager in a separate server from the base configuration,
and the base configuration coordination queue manager must be configured as an IBM MQ client, or MQI
channel.
The connection to the coordination queue manager is established by the fteSetupCoordination
command. If the coordination queue manager connection is not configured as an IBM MQ client channel,
at the partner server, commands such as fteListAgents fail when issued from the partner agent server.
Base topology with separate coordination queue manager and one partner agent
Figure 27. Base topology with separate coordination queue manager and one partner agent
Figure 28. Base topology with Managed File Transfer Agent partner
Connectivity considerations
In the preceding diagrams, each line across the agents and queue managers represents a connection to a
queue manager.
This connection might be:
• A local connection
• A bindings or message channel connection, or
• An IBM MQ client or MQI connection.
The type of connection you select in your configuration depends on the parameters you specify
• When you specify the queue manager name parameter without other connection parameters, you
specify a bindings connection.
If the queue manager used is local to the Managed File Transfer configuration, it also represents a local
connection, when used in the base configuration server.
• If you specify the queue manager name parameter, along with the corresponding host, port, and
channel name parameters, you specify an IBM MQ client connection.
When agents are located on the same host as the agent queue manager, a bindings type specification,
which results in a local connection, is more efficient.
Figure 29. Base topology with separate coordination queue manager and one partner agent
Procedure
1. Configure the coordination queue manager
2. Configure the command queue manager
3. Set up the agent
4. Set up the logger
5. Configure a partner server
Procedure
1. Log in as the Managed File Transfer administrator.
2. Issue the following command to identify the coordination queue manager and set up the configuration
directory structure:
5. Open the mft5.txt results file with your preferred editor. and ensure that the definitions have been
created successfully.
What to do next
Set up the command queue manager.
Procedure
Issue the following command:
What to do next
Set up the agent.
Procedure
1. Issue the following command:
After you create the agent with the fteCreateAgent command, the agents directory, and a
subdirectory for the agent, MFT4AGT1, are added to the MFT5 directory.
In the data\MFT5\agents\MFT4AGT1 directory you find the:
• agent.properties file
• MFT4AGT1_create.mqsc file, which containsIBM MQ definitions required by the agent.
2. Change to the data\MFT5\agents\MFT4AGT1 directory, and create the required agent queue
manager definitions by issuing the following command:
3. Open the mft4.txt results file with your preferred editor and ensure that the definitions have been
created successfully.
4. Start the agent by typing the following command: fteStartAgent MFT4AGT1.
5. Display the agent by typing the following command: fteListAgents.
You should see output similar to the following:
5655-MFT, 5724-H72 Copyright IBM Corp. 2008, 2024. ALL RIGHTS RESERVED
BFGPR0127W: No credentials file has been specified to connect to IBM MQ.
Note: if you have not enabled connection authentication in your Managed File Transfer environment,
you can ignore the BFGPR0127W message.
If you issue the ftelistAgents command and receive the following message, BFGCL0014W: No
agents exist that match the current selection criteria., see What to do if your MFT
agent is not listed by the fteListAgents command.
What to do next
Set up the logger.
Procedure
1. Issue the following command:
Results
You have configured the base server, which includes the coordination queue manager for this
configuration.
What to do next
You now do similar work for the partner server, which contains a remote agent.
Procedure
1. Create the partner server configuration directory by issuing the following command:
Notes:
a. When the coordination queue manager is on a different server from the partner server, the
connection to the base server coordination queue manager must be defined as a client connection.
Failure to define the coordination queue manager connection as an IBM MQ client connection, on
the partner server, causes any Managed File Transfer command, that connects to the coordination
queue manager, to fail.
An example of a command that connects to the coordination queue manager is fteListAgents.
b. You do not need to create the IBM MQ definitions as the definitions required by the coordination
queue manager were completed when you configured the base server.
2. Identify the commands queue manager by issuing the following command:
The commands queue manager does not require any extran IBM MQ definitions.
3. Identify the partner agent queue manager, and create the partner agent queue manager, by issuing the
following command:
a) Open file csm1.txt with your preferred editor to confirm that all agent required definitions have
been created successfully.
6. Start the agent, by issuing the following command:
fteStartAgent CSM1AGT1
C:\>fteListAgents
5655-MFT, 5724-H72 Copyright IBM Corp. 2008, 2024. ALL RIGHTS RESERVED
BFGPR0127W: No credentials file has been specified to connect to IBM MQ. Therefo
re, the assumption is that IBM MQ authentication has been disabled.
Agent Name: Queue Manager Name: Status:
CSM1AGT1 CSM1 READY
MFT4AGT1 MFT4 READY
Note: if you have not enabled connection authentication in your Managed File Transfer environment,
you can ignore the BFGPR0127W message.
If you issue the ftelistAgents command and receive the following message, BFGCL0014W: No
agents exist that match the current selection criteria., see What to do if your MFT
agent is not listed by the fteListAgents command.
If the status of one of the agents is UNREACHABLE, see What to do if an agent is shown as being in an
UNKNOWN state.
Procedure
1. Start IBM MQ Explorer.
2. In the left Navigator panel, scroll down and expand the folder: Managed File Transfer.
You see the entry for the Coordination queue manager: MFT5
3. Right click on MFT5 and select Connect.
a) Select Agents in the drop down menu that appears and ensure that both agents, MFT4AGT1 and
CSMAGT1, are in the Ready state.
What to do next
Test your example setup with IBM MQ Explorer.
C:\temp\mft> dir *
Date stamp 61 test-file.txt
1 File(s) 61 bytes
Procedure
1. Start the IBM MQ Explorer in Windows
2. In the left Navigator panel, expand the folder: Managed File Transfer.
You see the entry for the Coordination queue manager: MFT5
3. Right click on MFT5 and select Connect.
4. Once connected, right click on MFT5 and select New Transfer
a) Use the pull down menu to select MFT4AGT1 for the Source agent and CSMAGT1 for the
Destination agent.
b) Click Next.
c) Click Add on the next window.
A wide dialog appears. The left side is for Source and the right side for Destination.
5. On the Source panel:
a) Select Text transfer as the file is text.
b) Select Browse to locate the file.
In this case, the file is C:\temp\mft\test-file.txt.
Procedure
1. On the IBM MQ server, complete the following tasks:
• Define a queue manager called MQIPT.QM1.
• Define a server connection channel called MQIPT.CONN.CHANNEL.
• Define a local queue called MQIPT.LOCAL.QUEUE.
• Start a TCP/IP listener for MQIPT.QM1 on port 1414. If port 1414 is already in use by another
application choose a free port address and substitute it in the following examples.
• Ensure that connection authentication and channel authentication is configured to allow client
connections from the client machine with your user ID. If connection authentication is set to
require a user ID and password for client connections, you will need to set the MQSAMP_USER_ID
environment variable to the user ID to be used for connection authentication before running the
amqsputc and amqsgetc commands.
2. Test the route from the IBM MQ client to the queue manager by putting a message on the local
queue of the queue manager, by using the amqsputc command, and then retrieving it, by using the
amqsgetc command.
To prepare for the scenarios in this section, create and edit the mqipt.conf file as follows:
What to do next
After setting up your system, you are ready to start the following scenarios:
• “Verifying that MQIPT is working correctly” on page 161
• “Creating a key ring file” on page 163
• “Creating test certificates” on page 165
• “Authenticating a TLS server” on page 167
• “Authenticating a TLS client” on page 169
• “Configuring HTTP tunneling” on page 171
• “Configuring access control” on page 173
• “Configuring a SOCKS proxy” on page 175
• “Configuring a SOCKS client” on page 177
• “Configuring MQIPT clustering support” on page 178
• “Allocating port numbers” on page 181
• “Retrieving CRLs by using an LDAP server” on page 182
• “Running MQIPT in TLS proxy mode” on page 185
• “Running MQIPT in TLS proxy mode with a security manager” on page 187
• “Using a security exit” on page 189
• “Routing client connection requests to IBM MQ queue manager servers by using security exits” on page
191
• “Dynamically routing client connection requests” on page 194
• “Using a certificate exit to authenticate a TLS server” on page 197
This diagram shows the connection from the IBM MQ client (called client1.company1.com on port 1415)
through MQIPT to the IBM MQ server (called server1.company2.com on port 1414).
Procedure
To verify that MQIPT is working correctly, complete the following steps:
1. Define an MQIPT route.
On the MQIPT computer, edit mqipt.conf and add a route definition:
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
2. Start MQIPT.
Open a command prompt and enter the following command:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and ipt1
is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to:
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI078 Route 1415 ready for connection requests
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
Press the Enter key twice after typing the message string.
4.
To stop IBM MQ, enter the following command:
Procedure
Use one of the following methods to create a key ring file:
• Use the mqiptKeycmd command line interface (CLI)
a) Enter the following command to create a new PKCS #12 key ring file:
where:
– -db specifies the name of the key ring file (server_name.pfx).
– -pw specifies the key ring password (password) that you must later encrypt using the mqiptPW
command.
b) Enter the following command to create a new certificate request:
where:
– -file specifies a file name for the requested certificate.
– -label specifies a unique name of your choice; it is preferable not to include space characters.
– -dn specifies the appropriate Distinguished Name identity for the MQIPT route; for example,
"CN=Test Certificate,OU=Sales,O=Example,C=US".
– -sig_alg specifies the hash algorithm; for example, SHA256WithRSA.
mqiptKeyman
What to do next
You must also ensure that the CA certificate of the CA that signed the personal certificate is present in the
CA key ring file. Depending on your MQIPT configuration, the CA key ring file might be a different file from
the personal certificate key ring file.
To use a separate CA key ring file, you can either use the sample CA key ring file named
sslCAdefault.pfx that is supplied with MQIPT, or create a new PKCS #12 key ring file. You will need to
add the public CA certificate of the CA that signed your personal certificates to the CA key ring, unless it
is already present in the sample key ring file. The public CA certificate may have been returned with your
where:
• -db specifies the CA key ring file name, in this case sslCAdefault.pfx.
• -pw specifies the key ring password. The password for the sample CA key ring file named
sslCAdefault.pfx is mqiptSample.
• -file specifies the name of the file returned by the CA.
• -label specifies a unique name of your choice; it is preferable not to use space characters.
To add a CA certificate by using the iKeyman GUI:
• In the Key Database Content panel, select Signer Certificates from the drop-down list
• Click Add.
• Enter the name of the file containing the CA certificate, then click OK.
• Enter a label for the CA certificate. The label can be any unique name you choose; it is preferable not to
use space characters. Click OK.
Encrypt the key ring passwords by issuing the following command:
mqiptPW
Enter the key ring password to encrypt when prompted. Set the value of the appropriate property in the
mqipt.conf configuration file to the encrypted password that is output by the mqiptPW command; for
example, SSLServerKeyRingPW or SSLClientKeyRingPW, depending on whether the certificate is for
use by inbound or outbound connections. For more information about encrypting key ring passwords, see
Encrypting stored passwords to encrypt the key ring passwords.
To use these new key ring files for server authentication, place the key ring files in a directory named ssl
under the MQIPT home directory and set the following route properties:
SSLClientCAKeyRing=C:\\mqiptHome\\ssl\\sslCAdefault.pfx
SSLClientCAKeyRingPW=encrypted_password
SSLServerKeyRing=C:\\mqiptHome\\ssl\\myServer.pfx
SSLServerKeyRingPW=encrypted_password
SSLServerCAKeyRing=C:\\mqiptHome\\ssl\\sslCAdefault.pfx
SSLServerCAKeyRingPW=encrypted_password
See the scenario “Authenticating a TLS server” on page 167 for more information on configuring MQIPT to
use TLS.
Procedure
Use one of the following methods to create test certificates:
• Use the command-line interface (CLI)
a) Enter the following command to create a new PKCS #12 key ring file:
where:
– -db specifies the name of the key ring file (server_name.pfx).
– -pw specifies the key ring password (password) that you must later encrypt using the mqiptPW
utility.
b) Enter the following command to create a self-signed personal certificate for testing purposes:
where:
– -label specifies a unique name of your choice; it is preferable not to include space characters.
– -dn specifies the appropriate Distinguished Name identity for the MQIPT route; for example,
"CN=Test Certificate,OU=Sales,O=Example,C=US".
– -sig_alg specifies the hash algorithm; for example, SHA256WithRSA.
– -size specifies the size of the public key; for example, 2048.
If you use the example values given, this command creates a digital certificate with a 2048-bit RSA
public key and a digital signature that uses RSA with the SHA-256 hash algorithm.
When creating a certificate, take care to choose an appropriate public key encryption algorithm, key
size, and digital signature algorithm for your organization's security needs. See Digital certificate
considerations for MQIPT for more information.
• Use the GUI
a) Open the GUI by running the following command:
mqiptKeyman
What to do next
Encrypt the key ring passwords by issuing the following command:
mqiptPW
Enter the key ring password to encrypt when prompted. Set the value of the appropriate property in the
mqipt.conf configuration file to the encrypted password that is output by the mqiptPW command; for
example, SSLServerKeyRingPW or SSLClientKeyRingPW, depending on whether the certificate is for
use by inbound or outbound connections. For more information about encrypting key ring passwords, see
Encrypting stored passwords to encrypt the key ring passwords.
Procedure
To authenticate a TLS server, complete the following steps:
1. On the MQIPT 1 system:
a) Edit mqipt.conf and add the following route definition:
[route]
ListenerPort=1415
Destination=10.100.6.7
DestinationPort=1416
SSLClient=true
SSLClientKeyRing=C:\\mqipt\\samples\\ssl\\sslSample.pfx
SSLClientKeyRingPW=<mqiptPW>1!PCaB1HWrFMOp43ngjwgArg==!6N/vsbqru7iqMhFN+wozxQ==
SSLClientCipherSuites=SSL_RSA_WITH_AES_256_CBC_SHA256
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 is starting and will forward messages to :
MQCPI034 ....10.100.6.7(1416)
MQCPI035 ....using MQ protocol
MQCPI036 ....SSL Client side enabled with properties :
MQCPI139 ......secure socket protocols <NULL>
MQCPI031 ......cipher suites SSL_RSA_WITH_AES_256_CBC_SHA256
MQCPI032 ......key ring file C:\\mqipt\\samples\\ssl\\sslSample.pfx
MQCPI047 ......CA key ring file <NULL>
MQCPI071 ......site certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI038 ......peer certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI078 Route 1415 ready for connection requests
[route]
ListenerPort=1416
Destination=Server1.company2.com
DestinationPort=1414
SSLServer=true
SSLServerKeyRing=C:\\mqipt\\samples\\ssl\\sslSample.pfx
SSLServerKeyRingPW=<mqiptPW>1!PCaB1HWrFMOp43ngjwgArg==!6N/vsbqru7iqMhFN+wozxQ==
SSLServerCipherSuites=SSL_RSA_WITH_AES_256_CBC_SHA256
C:
cd \mqipt\bin
mqipt .. -n ipt2
where .. indicates that the MQIPT configuration file, mqipt.conf, is in the parent directory, and
ipt2 is the name to be given to the instance of MQIPT.
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqipt\logs will be used to store the log files
MQCPI006 Route 1416 is starting and will forward messages to :
MQCPI034 ....Server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI037 ....SSL Server side enabled with properties :
MQCPI139 ......secure socket protocols <NULL>
MQCPI031 ......cipher suites SSL_RSA_WITH_AES_256_CBC_SHA256
MQCPI032 ......key ring file C:\\mqipt\\samples\\ssl\\sslSample.pfx
MQCPI047 ......CA key ring file <NULL>
MQCPI071 ......site certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI038 ......peer certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI033 ......client authentication set to false
MQCPI078 Route 1416 ready for connection requests
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
This diagram shows the connection from the IBM MQ client (called client1.company1.com on port 1415)
through two instances of MQIPT to the IBM MQ server (called server1.company2.com on port 1414).
Procedure
To authenticating a TLS client, complete the following steps:
1. On the MQIPT 1 system:
a) Edit mqipt.conf and add the following route definition:
[route]
ListenerPort=1415
Destination=10.100.6.7
DestinationPort=1416
SSLClient=true
SSLClientKeyRing=C:\\mqipt\\samples\\ssl\\sslSample.pfx
SSLClientKeyRingPW=<mqiptPW>1!PCaB1HWrFMOp43ngjwgArg==!6N/vsbqru7iqMhFN+wozxQ==
SSLClientCipherSuites=SSL_RSA_WITH_AES_256_CBC_SHA256
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 is starting and will forward messages to :
MQCPI034 ....10.100.6.7(1416)
MQCPI035 ....using MQ protocol
MQCPI036 ....SSL Client side enabled with properties :
MQCPI139 ......secure socket protocols <NULL>
MQCPI031 ......cipher suites SSL_RSA_WITH_AES_256_CBC_SHA256
MQCPI032 ......key ring file C:\\mqipt\\samples\\ssl\\sslSample.pfx
MQCPI047 ......CA key ring file <NULL>
MQCPI071 ......site certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI038 ......peer certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI078 Route 1415 ready for connection requests
[route]
ListenerPort=1416
C:
cd \mqipt\bin
mqipt .. -n ipt2
where .. indicates that the MQIPT configuration file, mqipt.conf, is in the parent directory, and
ipt2 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqipt\logs will be used to store the log files
MQCPI006 Route 1416 is starting and will forward messages to :
MQCPI034 ....Server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI037 ....SSL Server side enabled with properties :
MQCPI139 ......secure socket protocols <NULL>
MQCPI031 ......cipher suites SSL_RSA_WITH_AES_256_CBC_SHA256
MQCPI032 ......key ring file C:\\mqipt\\samples\\ssl\\sslSample.pfx
MQCPI047 ......CA key ring file <NULL>
MQCPI071 ......site certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI038 ......peer certificate uses
UID=*,CN=*,T=*,OU=*,DC=*,O=*,STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI033 ......client authentication set to true
MQCPI078 Route 1416 ready for connection requests
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
This diagram shows the connection from the IBM MQ client (called client1.company1.com on port 1415)
through two instances of MQIPT, tunnelling the connection over HTTP, and finally to the IBM MQ server
(called server1.company2.com on port 1414).
Procedure
To configure HTTP tunneling between two instances of MQIPT, complete the following steps:
1. On the MQIPT 1 system:
a) Edit mqipt.conf and add the following route definition:
[route]
ListenerPort=1415
Destination=10.100.6.7
DestinationPort=8080
HTTP=true
HTTPServer=10.100.6.7
HTTPServerPort=8080
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 is starting and will forward messages to :
MQCPI034 ....10.100.6.7(8080)
MQCPI035 ....using HTTP
MQCPI066 ....and HTTP server at 10.100.6.7(8080)
MQCPI078 Route 1415 ready for connection requests
[route]
ListenerPort=8080
Destination=Server1.company2.com
DestinationPort=1414
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt2 is the name to be given to the instance of MQIPT.
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 8080 is starting and will forward messages to :
MQCPI034 ....Server1.company2.com(1414)
MQCPI035 ....using MQ protocols
MQCPI078 Route 8080 ready for connection requests
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
This diagram shows the connection from the IBM MQ client (called client1.company1.com on port 1415)
through MQIPT to the IBM MQ server (called server1.company2.com on port 1414).
Procedure
To configure access control, complete the following steps:
C:\mqipt\java\jre\bin\policytool
to:
file:/C:/mqipt/lib/com.ibm.mq.ipt.jar
e) Change the file permissions for the IBM MQ Internet Pass-Thru, errors and logs directories
from:
to:
C:\mqiptHome
to:
C:\mqipt
Permission: java.net.SocketPermission
Target: client1.company1.com:1024-
Actions: accept, listen, resolve
h) Click File > Save to save the changes to the policy file.
i) Edit mqipt.conf.
i) Add the following two properties to the [global] section:
SecurityManager=true
SecurityManagerPolicy=C:\mqiptHome\mqipt.policy
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
2. Start MQIPT:
Open a command prompt and enter the following:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and ipt1
is the name to be given to the instance of MQIPT.
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI055 Setting the java.security.policy to C:\mqiptHome\mqipt.policy
MQCPI053 Starting the Java Security Manager
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI078 Route 1415 ready for connection requests
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
socks-enabled
IBM MQ client MQIPT IBM MQ server
client1.company1.com 10.9.1.2 10.920.5.6
This diagram shows the connection flow from the IBM MQ client (called client1.company1.com on port
1415) through MQIPT to the IBM MQ server (called server1.company2.com on port 1414).
Procedure
To configure a SOCKS proxy, complete the following steps:
1. Configure and start MQIPT:
a) Edit mqipt.conf and add the following route definition:
[route]
ListenerPort=1080
Destination=server1.company2.com
DestinationPort=1414
SocksServer=true
The values of the Destination and DestinationPort route properties are ignored as the true
destination is obtained from the IBM MQ client during the SOCKS handshaking process.
b) Open a command prompt and start MQIPT:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1080 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI052 ....SOCKS server side enabled
MQCPI078 Route 1080 ready for connection requests
2. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.20.5.6(1414)
This diagram shows the network connection from the IBM MQ client (called client1.company1.com on
port 1415) through MQIPT, then through the SOCKS proxy (on port 1080) to the IBM MQ server (called
server1.company2.com on port 1414).
Procedure
To configure a SOCKS client, complete the following steps:
1. Set up MQIPT.
On the MQIPT computer, edit mqipt.conf and add a route definition:
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
SocksClient=true
SocksProxyHost=10.9.6.7
SocksProxyPort=1080
2. Start MQIPT.
Open a command prompt and enter:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and ipt1
is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI039 ....and SOCKS proxy at 10.9.6.7(1080)
MQCPI078 Route 1415 ready for connection requests
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
This diagram shows the connections from the IBM MQ clients through MQIPT to the IBM MQ servers.
Only one application can listen on a given port on the same computer. If port 1414 is already in use,
choose a free port and substitute it in the examples.
You can then test the routes between the queue managers by putting a message on the local queue on
the LONDON server and retrieving it from the NEWYORK server.
Procedure
To configure MQIPT clustering support, complete the following steps:
1. Set up the LONDON server.
Open a command prompt and enter the following commands:
runmqsc
DEFINE CHANNEL(TO.LONDON) +
CHLTYPE(CLUSRCVR) TRPTYPE(TCP) +
CLUSTER(INVENTORY) +
CONNAME('10.10.6.7(1414)')
DEFINE CHANNEL(TO.NEWYORK) +
CHLTYPE(CLUSSDR) TRPTYPE(TCP) +
CLUSTER(INVENTORY) +
CONNAME('10.9.20.5(1414)')
runmqsc
ALTER QMGR REPOS(INVENTORY)
DEFINE QLOCAL(MQIPT.LOCAL.QUEUE) +
CLUSTER(INVENTORY)
DEFINE CHANNEL(TO.NEWYORK) +
CHLTYPE(CLUSRCVR) TRPTYPE(TCP) +
CLUSTER(INVENTORY) +
CONNAME('10.9.20.5(1414)')
DEFINE CHANNEL(TO.LONDON) +
CHLTYPE(CLUSSDR) TRPTYPE(TCP) +
CLUSTER(INVENTORY) +
CONNAME('10.10.6.7(1414)')
3. Set up MQIPT 1.
Edit mqipt.conf and add the following route definitions:
[route]
Name=LONDON to NEWYORK
ListenerPort=1415
Destination=10.9.20.5
DestinationPort=1414
[route]
Name=MQIPT1 to LONDON
ListenerPort=1414
Destination=10.7.20.2
DestinationPort=1414
4. Start MQIPT 1.
Open a command prompt and enter:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and ipt1
is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....10.9.20.5(1414)
MQCPI035 ....using MQ protocol
MQCPI052 ....SOCKS server side enabled
MQCPI078 Route 1415 ready for connection requests
MQCPI006 Route 1414 has started and will forward messages to :
MQCPI034 ....10.7.20.2(1414)
MQCPI035 ....using MQ protocol
MQCPI078 Route 1414 ready for connection requests
5. Set up MQIPT 2.
Edit mqipt.conf and add the following route definitions:
[route]
Name=NEWYORK to LONDON
ListenerPort=1415
Destination=10.10.6.7
DestinationPort=1414
SocksServer=true
[route]
Name=MQIPT2 to NEWYORK
ListenerPort=1414
Destination=10.9.1.2
DestinationPort=1414
6. Start MQIPT 2.
Open a command prompt and enter the following commands:
C:
cd \mqipt\bin
mqipt .. -n ipt2
where .. indicates that the MQIPT configuration file, mqipt.conf, is in the parent directory, and
ipt2 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqipt\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....10.10.6.7(1414)
MQCPI035 ....using MQ protocol
MQCPI052 ....SOCKS server side enabled
MQCPI078 Route 1415 ready for connection requests
MQCPI006 Route 1414 has started and will forward messages to :
7. At a command prompt on the LONDON IBM MQ client (10.7.20.1), enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.7.20.2(1414)
b) Put a message:
SET MQSERVER=MQIPT.CONN.CHANNEL/TCP/10.9.1.2(1414)
This diagram shows the connection from an IBM MQ client (client1.company1.com on port 1415) through
MQIPT to an IBM MQ server (server1.company2.com on port 1414).
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
LocalAddress=10.10.6.7
OutgoingPort=2000
MaxConnectionThreads=20
2. Start MQIPT.
Open a command prompt on the IBM MQ system, and enter the following command:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and ipt1
is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 is starting and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI069 ....binding to local address 10.10.6.7 when making new connections
MQCPI070 ....using local port address range 2000-2019 when making new connections
MQCPI078 Route 1415 ready for connection requests
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.7.20.5(1415)
b) Put a message:
This diagram shows the connection from the IBM MQ client (client1.company1.com on port 1415)
through two instances of MQIPT to the IBM MQ server (server1.company2.com on port 1414). The first
MQIPT has a connection to an LDAP server (crl.ca_company.com on port 389).
Procedure
To retrieve CRLs by using an LDAP server, complete the following steps:
1. On the MQIPT 1 system:
a) Edit mqipt.conf and add the following route definition:
[route]
ListenerPort=1415
Destination=10.100.6.7
DestinationPort=1416
where encrypted_key_ring_password is the password for the caCerts.pfx key ring, encrypted
using the mqiptPW command.
b) Open a command prompt and start MQIPT:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....10.100.6.7(1416)
MQCPI035 ....using MQ protocol
MQCPI036 ....SSL Client side enabled with properties :
MQCPI031 ......CipherSuites <NULL>
MQCPI032 ......key ring file <NULL>
MQCPI047 ......CA key ring file C:\mqiptHome\ssl\caCerts.pfx
MQCPI071 ......site certificate uses UID=*,CN=*,T=*,OU=*,DC=*,O=*,
STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI038 ......peer certificate uses UID=*,CN=*,T=*,OU=*,DC=*,O=*,
STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI075 ....LDAP main server at crl.ca_company.com(389)
MQCPI086 ......timeout of 4 second(s)
MQCPI084 ....CRL cache expiry timeout is 1 hour(s)
MQCPI085 ....CRLs will be saved in the key-ring file(s)
MQCPI078 Route 1415 ready for connection requests
[route]
ListenerPort=1416
Destination=server1.company2.com
DestinationPort=1414
SSLServer=true
SSLServerKeyRing=C:\mqipt\ssl\myCert.pfx
SSLServerKeyRingPW=encrypted_key_ring_password
where encrypted_key_ring_password is the password for the myCert.pfx key ring, encrypted
using the mqiptPW command.
b) Open a command prompt and start MQIPT:
C:
cd \mqipt\bin
mqipt .. -n ipt2
where .. indicates that the MQIPT configuration file, mqipt.conf, is in the parent directory, and
ipt2 is the name to be given to the instance of MQIPT.
The following message indicates successful completion:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqipt\logs will be used to store the log files
MQCPI006 Route 1416 is starting and will forward messages to :
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
This diagram shows the connection flow from the IBM MQ client (client1.company1.com on port 1415)
through MQIPT to the IBM MQ server (server1.company2.com on port 1414).
For further information on configuring TLS for IBM MQ, refer to Working with SSL/TLS.
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
SSLProxyMode=true
b) Start MQIPT.
Open a command prompt and enter the following command:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using SSLProxyMode protocol
MQCPI078 Route 1415 ready for connection requests
3. At a command prompt on the IBM MQ client system, enter the following command to run the TLS
sample program:
This diagram shows the connection flow from the IBM MQ client (client1.company1.com on port 1415)
through MQIPT to the IBM MQ server (server1.company2.com on port 1414).
For further information on configuring TLS for IBM MQ, refer to Working with SSL/TLS.
Procedure
To run MQIPT in TLS proxy mode with a security manager, complete the following steps:
1. Configure the IBM MQ client and server to use a TLS connection.
a) Create a key repository for the queue manager.
For more information, see Setting up a key repository on AIX, Linux, and Windows.
b) Create a key repository for the client in the C:\ProgramData\IBM\MQ directory. Call it
clientkey.kdb.
c) Create a personal certificate for the queue manager, in the queue manager key repository that you
created in step “1.a” on page 187.
For more information, see Creating a self-signed personal certificate on AIX, Linux, and Windows.
d) Create a personal certificate for the client, in the client key repository that you created in step “1.b”
on page 187.
e) Extract the personal certificate from the server key repository and add it to the client repository.
For more information, see Extracting the public part of a self-signed certificate from a key
repository on AIX, Linux, and Windows, and Adding a CA certificate (or the public part of a self-
signed certificate) into a key repository, on AIX, Linux, and Windows systems.
f) Extract the personal certificate from the client key repository and add it to the server key
repository.
2. On the MQIPT computer (see the diagram), copy the sample Java security manager policy to the
MQIPT home directory, by entering the following command at a command prompt:
C:\mqipt\java\jre\bin\policytool
to:
file:/C:/mqipt/lib/com.ibm.mq.ipt.jar
d) Change the file permissions for the IBM MQ Internet Pass-Thru, errors and logs directories
from:
to:
C:\mqiptHome
to:
C:\mqipt
Permission: java.net.SocketPermission
Target: client1.company1.com:1024-
Actions: accept, listen, resolve
g) Click File > Save to save the changes to the policy file.
4. Edit mqipt.conf. Add the following properties to the [global] section and add the following route
definition:
[global]
SecurityManager=true
SecurityManagerPolicy=C:\mqiptHome\mqipt.policy
[route]
ListenerPort=1415
Destination=server1.company2.com
5. Start MQIPT.
Open a command prompt, and enter the following command:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and ipt1
is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI055 Setting the java.security.policy to C:\mqiptHome\mqipt.policy
MQCPI053 Starting the Java Security Manager
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\mqipt\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using SSLProxyMode protocol
MQCPI078 Route 1415 ready for connection requests
6. At a command prompt on the IBM MQ client system, enter the following command to run the TLS
sample program:
where cert_label is the label of the client certificate that you created in step “1.d” on page 187.
This diagram shows the connection flow from the IBM MQ client (called client1.company1.com on port
1415) through MQIPT to the IBM MQ server (called server1.company2.com on port 1414).
Procedure
To use a security exit, complete the following steps:
1. On the MQIPT computer:
a) Create a directory called exits in the MQIPT home directory by issuing the following command in a
command prompt:
md C:\mqiptHome\exits
b) Enter the following commands to compile the exit. You do not have to do this if you have not
changed the exit code as the compiled sample exit is supplied with MQIPT.
C:
cd \mqipt\samples\exits
javac -classpath C:\mqipt\lib\com.ibm.mq.ipt.jar;. SampleSecurityExit.java
c) Enter the following command to copy the compiled exit class file SampleSecurityExit.class
to the C:\mqiptHome\exits directory:
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
SecurityExit=true
SecurityExitName=SampleSecurityExit
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
2. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
This diagram shows the connection flow from the IBM MQ client (called client1.company1.com on port
1415) through MQIPT to three IBM MQ servers (called server1.company2.com, server2.company2.com,
and server3.company2.com).
Procedure
To route client connection requests sequentially to three different IBM MQ queue manager servers by
using security exits, complete the following steps:
1. Create three identical queue managers named MQIPT.QM1 on three separate servers.
Each queue manager has a SVRCONN channel named MQIPT.CONN.CHANNEL and an empty local
queue named MQIPT.LOCAL.QUEUE.
2. On the MQIPT server:
a) Create a directory called exits in the MQIPT home directory by issuing the following command in a
command prompt:
md C:\mqiptHome\exits
server1.company2.com:1414
server2.company2.com:1415
server3.company2.com:1416
Ensure that there are no blank lines before the first entry in the file and that each entry is a
valid server name. If you have used different server names, change these names to match your
environment.
C:
cd \mqipt\samples\exits
javac -classpath C:\mqipt\lib\com.ibm.mq.ipt.jar;. SampleRoutingExit.java
d) Enter the following command to copy the compiled exit class file SampleRoutingExit.class to
the C:\mqiptHome\exits directory:
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
SecurityExit=true
SecurityExitPath=C:\mqiptHome\exits
SecurityExitName=SampleRoutingExit
Note that you do not have to set SecurityExitPath if you put SampleRoutingExit.conf in
the default C:\mqiptHome\exits directory.
f) Start MQIPT.
Open a command prompt and enter the following command:
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI079 ....using security exit C:\mqiptHome\exits\SampleRoutingExit
MQCPI080 ......and timeout of 30 seconds
MQCPI078 Route 1415 ready for connection requests
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/TCP/10.9.1.2(1415)
The messages, Hello world 1, Hello world 2, and Hello world 3 are returned.
This diagram shows the connection flow from the IBM MQ client (called client1.company1.com on port
1415) through MQIPT to three IBM MQ servers (called server1.company2.com, server2.company2.com,
and server3.company2.com).
md C:\mqiptHome\exits
server1.company2.com:1414
server2.company2.com:1415
server3.company2.com:1416
Ensure that there are no blank lines before the first entry in the file and that each entry is a
valid server name. If you have used different server names, change these names to match your
environment.
Note that all queue manager names in the list must be unique. If you list the same name more
than once, even if the queue managers are on different servers, only the last entry for that name is
registered.
c) Open a command prompt and enter the following commands to compile the exit. You do not have to
do this if you have not changed the exit code as the compiled sample exit is supplied with MQIPT.
C:
cd \mqipt\samples\exits
javac -classpath C:\mqipt\lib\com.ibm.mq.ipt.jar;. SampleOneRouteExit.java
d) Enter the following command to copy the compiled exit class file SampleOneRouteExit.class
to the C:\mqiptHome\exits directory:
[route]
ListenerPort=1415
Destination=server1.company2.com
DestinationPort=1414
SecurityExit=true
SecurityExitName=SampleOneRouteExit
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt2 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=QM1.MQIPT.CHANNEL/TCP/10.9.1.2(1415)
b) Put a message:
SET MQSERVER=QM2.MQIPT.CHANNEL/TCP/10.9.1.2(1415)
e) Put a message:
SET MQSERVER=QM3.MQIPT.CHANNEL/TCP/10.9.1.2(1415)
h) Put a message:
This diagram shows the connection from the IBM MQ client (called client1.company1.com on port 1415)
through two instances of MQIPT to the IBM MQ server (called server1.company2.com on port 1414).
Procedure
To use a certificate exit to authenticate an TLS server, complete the following steps:
1. On the MQIPT 1 system:
a) Create a directory called exits in the MQIPT home directory by issuing the following command in a
command prompt:
md C:\mqiptHome\exits
b) Open a command prompt and enter the following commands to compile the exit. You do not have to
do this if you have not changed the exit code as the compiled sample exit is supplied with MQIPT.
C:
cd \mqipt\samples\exits
javac -classpath C:\mqipt\lib\com.ibm.mq.ipt.jar;. SampleCertificateExit.java
c) Enter the following command to copy the compiled exit class file
SampleCertificateExit.class to the C:\mqiptHome\exits directory:
[route]
ListenerPort=1415
Destination=9.100.6.7
DestinationPort=1416
SSLClient=true
SSLClientKeyRing=C:\mqipt\samples\ssl\sslSample.pfx
SSLClientKeyRingPW=<mqiptPW>1!PCaB1HWrFMOp43ngjwgArg==!6N/vsbqru7iqMhFN+wozxQ==
SSLClientExit=true
SSLExitName=SampleCertificateExit
SSLExitPath=C:\mqiptHome\exits
SSLExitData=allow
where C:\mqiptHome indicates the location of the MQIPT configuration file, mqipt.conf, and
ipt1 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt1
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
MQCPI006 Route 1415 has started and will forward messages to :
MQCPI034 ....9.100.6.7(1416)
MQCPI035 ....using MQ protocol
MQCPI036 ....SSL Client side enabled with properties :
MQCPI031 ......CipherSuites <null>
MQCPI032 ......keyring file C:\mqipt\samples\ssl\sslSample.pfx
MQCPI047 ......CA keyring file <null>
MQCPI038 ......peer certificate uses UID=*,CN=*,T=*,OU=*,DC=*,O=*,
STREET=*,L=*,ST=*,PC=*,C=*,DNQ=*
MQCPI129 ......using certificate exit C:\mqiptHome\exits\SampleCertificateExit
MQCPI131 ......and certificate exit data 'allow'
MQCPI078 Route 1415 ready for connection requests
[route]
ListenerPort=1416
Destination=Server1.company2.com
DestinationPort=1414
SSLServer=true
SSLServerKeyRing=C:\mqipt\samples\ssl\sslSample.pfx
SSLServerKeyRingPW=C:\mqipt\samples\ssl\sslSample.pwd
C:
cd \mqipt\bin
mqipt .. -n ipt2
where .. indicates that the MQIPT configuration file, mqipt.conf, is in the parent directory, and
ipt2 is the name to be given to the instance of MQIPT.
The following messages indicate that MQIPT has started successfully:
5724-H72 (C) Copyright IBM Corp. 2000, 2024. All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.2.0.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI152 MQIPT name is ipt2
MQCPI021 Password checking has been enabled on the command port
MQCPI011 The path C:\mqipt\logs will be used to store the log files
MQCPI006 Route 1416 has started and will forward messages to :
MQCPI034 ....server1.company2.com(1414)
MQCPI035 ....using MQ protocol
MQCPI037 ....SSL Server side enabled with properties :
MQCPI031 ......CipherSuites <null>
3. At a command prompt on the IBM MQ client system, enter the following commands:
a) Set the MQSERVER environment variable:
SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.9.1.2(1415)
b) Put a message:
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of
the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this
one) and (ii) the mutual use of the information which has been exchanged, should contact:
IBM Corporation
Software Interoperability Coordinator, Department 49XA
3605 Highway 52 N
Rochester, MN 55901
U.S.A.
Trademarks
IBM, the IBM logo, ibm.com®, are trademarks of IBM Corporation, registered in many jurisdictions
worldwide. A current list of IBM trademarks is available on the Web at "Copyright and trademark
information"www.ibm.com/legal/copytrade.shtml. Other product and service names might be trademarks
of IBM or other companies.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or
both.
202 Notices
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
This product includes software developed by the Eclipse Project (https://www.eclipse.org/).
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or
its affiliates.
Notices 203
204 IBM MQ Scenarios
IBM®
Part Number:
(1P) P/N: