Japanese

Practical mastering IBM MQ basics

Connection mode (1)

*This series may be revised based on the latest mqpgf/mqpcf. Please always download and use the latest version.


Overview of connection mode

By actually running and confirming the functions related to each field of MQMD, you should have an approximate image of IBM MQ. Next, I explain the various modes in which the application connects to the queue manager.

Connection types are often described separately using the terms binding connection and client connection (called binding mode, client mode in MQ Java). Here, binding connection refers to the connection mode used by the application on the same machine as the machine on which the queue manager is running. Client connection is a mode to connect using TCP/IP etc. from the outside of the machine where the queue manager is running. In C language, an application is distinguished into a server application or a client application by a linked library. An application linked to a server library (libmqm, libmqm_r, libmqm64, libmqm64_r) is called a server application. An application linked to a client library (libmqic, libmqic_r, libmqic64, libmqic64_r) is called a client application. Refer to the product manual for how to create / compile each application. In the programs introduced in this series, mqpgf and mqpcf are linked to the server library, and mqpgfc and mqpcfc are linked to the client library. MQI calls issued by the application are executed by a process / thread called the Local Queue Manager Agent(LQMA). In the case of bind connection, there are three further modes of isolation of interface between application and agenttime: FAST, SHARED and ISOLATED. The isolation level increases in the order of FAST, SHARED, and ISOLATED, and the highest ISOLATED is the connection mode in which the queue manager is the least susceptible to application abnormal processing. Conversely, FAST, which has the lowest isolation level, has the risk of the queue manager being directly affected by application anomalies, but its performance is superior to other modes. Select the appropriate isolation level according to your system requirements.

to the top

Type of connection mode

This section describes the types of connection modes and their outlines. The MQCNO connection options in parentheses can be specified when using MQCONNX(). When using MQCONN(), this option can not be specified directly, so use other methods (described later).


STANDARD BINDING(MQCNO_STANDARD_BINDING)

This is default option. If MQCONN() is used, or MQCONNX() is used with MQCNO_STANDARD_BINDING(default), it connects in the mode specified by the DefaultBindType attribute of the Connection stanza in qm.ini. SHARED or ISOLATED can be specified for DefaultBindType.

Connection:
DefaultBindType=SHARED|ISOLATED

The default value is SHARED.
Note) For MQ8 for HP NonStop, the special value MQCNO_GUARDIAN_BINDING is used.

MQCNO_GUARDIAN_BINDING 0x00020000

Also, if MQCONN() is used, or MQCONNX() with MQCNO_STANDARD_BINDING(default) is used, its connection mode can be changed by setting the MQ_CONNECT_TYPE environment variable to one of the following:

CLIENT: Client connection attempt only.
FASTPATH: If specified in the current version, it is ignored (supported in previous releases).
LOCAL: Server connection attempt only. Fastpass connections are downgraded to other server connection types.
STANDARD: In the current version, the same process as LOCAL.


FASTPATH BINDING(MQCNO_FASTPATH_BINDING)

Applications that connect in this mode are called trusted applications. In this mode, the local queue manager agent is in the same process as the user application. In other words, the application's process accesses MQ resources such as queues directly from the application's program without going through the local queue manager agent which is another process in the queue manager. While the performance is maximized, it is a high risk connection mode. There are some limitations when using a trusted application, so check in advance the product documentation.


SHARED BINDING(MQCNO_SHARED_BINDING)

This mode is the default for most platforms. Communication between an application and an agent uses shared memory, and the application and agent processes share some of the system's resources. Use this mode unless you have a specific reason.


ISOLATED BINDING(MQCNO_ISOLATED_BINDING)

In this mode, the application and the local queue manager agent do not share resources and are isolated. Applications and local queue manager agents use UNIX domain sockets for this isolated binding on Unix-like platforms.


LOCAL BINDING(MQCNO_LOCAL_BINDING)

Connected by a server connection (either FASTPATH_BINDING, SHARED_BINDING, or ISOLATED_BINDING). If this is specified, it is only one of these three server connection types. The connection mode cannot be changed to client connection as in STANDARD BINDING. If neither MQCNO_FASTPATH_BINDING, MQCNO_SHARED_BINDING nor MQCNO_ISOLATED_BINDING is specified, the default connection mode is selected.


CLIENT BINDING(MQCNO_CLIENT_BINDING)

A client connection is attempted. In C language, binding connection and client connection are linked to different libraries, but you can also make an application linked to the server library attempt client connection. However, the reverse attempt fails with 2568 MQRC_CONNECTION_NOT_AVAILABLE.

>mqpgfc -qm SampleQM -q SampleQ MQCNO_LOCAL_BINDING
MQCONNX fail : SampleQM CompCd=02 ReasonCd=2568
!!! Queue Manager Connect Fail !!!

$ mqrc 2568

2568 0x00000a08 MQRC_CONNECTION_NOT_AVAILABLE

to the top

How to check connection mode

Here's how to check if your application is connecting in the intended connection mode.
*The following method can not be used with MQ 5.3.1 for HP NonStop.
With the runmqsc command, you can check with CONNOPTS displayed by the following command.

MQSC dis conn(*) type(conn) CONNOPTS


Ex. 6.1 How to check connection mode

Check what mode the application is in when it is actually connected. mqpgf uses MQCONNX() only when one or more MQCNO_*s are specified. If MQCNO_* is not specified, it calls MQCONN() to connect. All connections are made in the default state(the DefaultBindType attribute is not specified in qm.ini, the MQ_CONNECT_TYPE environment variable is not set, and MQCNO_* is not specified either). Here, specify -s MQCLOSE to keep mqpgf connected.

>mqpgf -qm SampleQM -q SampleQ -s MQCLOSE
no message available : SampleQ CompCd=02 ReasonCd=2033
stop before calling MQCLOSE().
Hit Any Key!!!

Run the following command at another terminal / command prompt:


Test result 6.1.1

>mqpcf con -qm SampleQM conn APPLTAG CONNOPTS
1: CONN(414D514353616D706C65514D20202020DB9E515B237FCA01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
2: CONN(414D514353616D706C65514D20202020DB9E515B237FC901) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
3: CONN(414D514353616D706C65514D20202020DB9E515B237FC801) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
4: CONN(414D514353616D706C65514D20202020DB9E515B237FC701) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
5: CONN(414D514353616D706C65514D20202020DB9E515B237FC601) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
6: CONN(414D514353616D706C65514D20202020DB9E515B237FC501) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
7: CONN(414D514353616D706C65514D20202020DB9E515B237FC401) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfqpub.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
8: CONN(414D514353616D706C65514D20202020DB9E515B237FC301) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfqpub.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
9: CONN(414D514353616D706C65514D20202020DB9E515B237FC201) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfqpub.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
10: CONN(414D514353616D706C65514D20202020DB9E515B237FC101) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmuf0.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
11: CONN(414D514353616D706C65514D20202020DB9E515B237FC001) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmuc0.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
12: CONN(414D514353616D706C65514D20202020DB9E515B237FBF01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmuf0.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
13: CONN(414D514353616D706C65514D20202020DB9E515B237FBE01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmuf0.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
14: CONN(414D514353616D706C65514D20202020DB9E515B237FBD01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmuf0.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
15: CONN(414D514353616D706C65514D20202020DB9E515B237FBC01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmuf0.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
16: CONN(414D514353616D706C65514D20202020DB9E515B237FDA01) TYPE(CONN) APPLTAG(am\win\mqpcf\Debug\mqpcf.exe) CONNOPTS(MQCNO_SHARED_BINDING)
17: CONN(414D514353616D706C65514D20202020DB9E515B237FD601) TYPE(CONN) APPLTAG(am\win\mqpgf\Debug\mqpgf.exe) CONNOPTS(MQCNO_SHARED_BINDING)
18: CONN(414D514353616D706C65514D20202020DB9E515B237FB201) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqrrmfa.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
19: CONN(414D514353616D706C65514D20202020DB9E515B237FD201) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmur0.exe) CONNOPTS(MQCNO_SHARED_BINDING)
20: CONN(414D514353616D706C65514D20202020DB9E515B237FB101) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzfuma.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)
21: CONN(414D514353616D706C65514D20202020DB9E515B237FD001) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqpcsea.exe) CONNOPTS(MQCNO_SHARED_BINDING)
22: CONN(414D514353616D706C65514D20202020DB9E515B237FCF01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\runmqchi.exe) CONNOPTS(MQCNO_SHARED_BINDING)
23: CONN(414D514353616D706C65514D20202020DB9E515B237FCD01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqzmur0.exe) CONNOPTS(MQCNO_SHARED_BINDING)
24: CONN(414D514353616D706C65514D20202020DB9E515B237FCB01) TYPE(CONN) APPLTAG(es\IBM\MQ\bin64\amqfcxba.exe) CONNOPTS(MQCNO_FASTPATH_BINDING)

*Option descriptions
con: Run the Inquire connection (MQCMD_INQUIRE_CONNECTION) command.
conn: Specify MQIACF_CONN_INFO_CONN as the connection information type (MQIACF_CONN_INFO_TYPE)
CONNOPTS: Display connection options.

You can see that "mqpgf.exe" is connected with MQCNO_SHARED_BINDING. This command also shows the connection mode of the queue manager process other than the application. Except for amqzmur0 (restartable process manager), amqpcsea (command server), and runmqchi (channel initiator process), you can confirm that MQCNO_FASTPATH_BINDING is used.

It is also possible to display information with a specific APPLTAG. Specify a program name after "-ap". In case of Unix-like OS, only program name is specified (example: mqpgf), but in case of Windows, it is necessary to specify 28 characters after full path as shown below.


Test result 6.1.2

>mqpcf con -qm SampleQM -ap am\win\mqpgf\Debug\mqpgf.exe
1: CONN(414D514353616D706C65514D20202020DB9E515B237FD601) TYPE(ALL) APPLDESC() APPLTAG(am\win\mqpgf\Debug\mqpgf.exe) APPLTYPE(USER) ASTATE(NONE) CHANNEL() CONNAME() CONNOPTS(MQCNO_SHARED_BINDING) PID(103768) QMURID (0000000000...) UOWLOG() TID(1) URID(0000000000...) UOWLOGDA() UOWLOGTI() UOWSTATE(MQUOWST_NONE) UOWSTDA() UOWSTTI() URTYPE(QMGR) USERID(mquser)
2: CONN(414D514353616D706C65514D20202020DB9E515B237FD601) TYPE(ALL) OBJNAME(SampleQ) OBJTYPE(QUEUE) ASTATE(NONE) HSTATE(INACTIVE) OPENOPTS(MQOO_INPUT_SHARED) READA(NO)

*Option descriptions
-ap: Application tag to be displayed(APPLTAG)

When executing "mqpcf con", if neither "conn" (type (conn) in "display conn") nor "handle" (type (handle) in "display conn") is specified, the above result will be obtained. Both are output like this. "1:" is the information displayed when "type (conn)" of "display conn" is specified in the runmqsc command, and "2:" is the information displayed when "type (handle)" is specified.

fig 6.1

to the top

Change connection mode

Change the connection mode and check it.


Ex. 6.2 Change the connection mode by qm.ini

The location of qm.ini varies depending on the platform and the version of MQ. You can also change the location. The following is the default location for reference.

Windows (MQ 8.0 or higher): C:\ProgramData\IBM\MQ\qmgrs\<qmgr name>\qm.ini
Unix-like OS: /var/mqm/qmgrs/<qmgr name>/qm.ini
MQ5.3 for HP NonStop: $MQNSKVARPATH/qmgrs/<qmgr name>/qm.ini
MQ8.0 for HP NonStop: $MQINST/qmgrs/<qmgr name>/qm.ini

Check the status before setting connection mode in qm.ini.

>mqpgf -qm SampleQM -q SampleQ -s MQCLOSE
no message available : SampleQ CompCd=02 ReasonCd=2033
stop before calling MQCLOSE().
Hit Any Key!!!

>mqpcf con -qm SampleQM conn -ap am\win\mqpgf\Debug\mqpgf.exe CONNOPTS
1: CONN(414D514353616D706C65514D20202020FB00585B20FBEB01) TYPE(CONN) CONNOPTS(MQCNO_SHARED_BINDING)

Add the following two lines to the last line of qm.ini:

Connection:
DefaultBindType=ISOLATED

Remember that you will need to restart the queue manager for the changes in qm.ini to take effect.
After restarting the queue manager, check the connection options again.


Test result 6.2

>mqpgf -qm SampleQM -q SampleQ -s MQCLOSE
no message available : SampleQ CompCd=02 ReasonCd=2033
stop before calling MQCLOSE().
Hit Any Key!!!

>mqpcf con -qm SampleQM conn -ap am\win\mqpgf\Debug\mqpgf.exe CONNOPTS
1: CONN(414D514353616D706C65514D202020208494565B23B22E01) TYPE(CONN) CONNOPTS(MQCNO_ISOLATED_BINDING)

You can confirm that you are connected with MQCNO_ISOLATED_BINDING.

fig 6.2


Ex. 6.3 Change the connection mode by specifying the MQCNO_* option.

Trusted applications are limited in the user ID they can run. On UNIX-based operating systems, both user ID and group ID must be "mqm". Also, for Linux, trusted 32-bit applications are not supported. Therefore, the linux 32-bit version of mqpgf cannot be connected with the FASTPATH binding. Constraints vary by platform, so please refer to the product manual for details. The following is an example of MQ8 for HP NonStop.

$ id
uid=44031(MQM.MANAGER) gid=171(MQM)

The default connection mode is MQCNO_GUARDIAN_BINDING.

$ mqpgf -qm SampleQM -q SampleQ -s MQCLOSE
no message available : SampleQ CompCd=02 ReasonCd=2033
MQCMIT success : CompCd=00 ReasonCd=00
stop before calling MQCLOSE().
Hit Any Key!!!

$ mqpcf con -qm SampleQM -ap mqpgf
1: CONN(414D514353616D706C65514D202020205B552CF720004A01) TYPE(ALL) APPLDESC() APPLTAG(mqpgf) APPLTYPE(USER) ASTATE(NONE) CHANNEL() CONNAME() CONNOPTS(MQCNO_GUARDIAN_BINDING) PID(284558155) QMURID(00000000....) UOWLOG() TID(1) URID(00000000....) UOWLOGDA() UOWLOGTI() UOWSTATE(MQUOWST_NONE) UOWSTDA() UOWSTTI() URTYPE(QMGR) USERID(mqm)
2: CONN(414D514353616D706C65514D202020205B552CF720004A01) TYPE(ALL) OBJNAME(SampleQ) OBJTYPE(QUEUE) ASTATE(NONE) HSTATE(INACTIVE) OPENOPTS(MQOO_INPUT_SHARED) READA(NO)

Add MQCNO_FASTPATH_BINDING to the same command as before. mqpgf calls MQCONNX() with MQCNO_FASTPATH_BINDING instead of MQCONN() because MQCNO_* was specified.

$ mqpgf -qm SampleQM -q SampleQ -s MQCLOSE MQCNO_FASTPATH_BINDING
no message available : SampleQ CompCd=02 ReasonCd=2033
MQCMIT success : CompCd=00 ReasonCd=00
stop before calling MQCLOSE().
Hit Any Key!!!


Test result 6.3

$ mqpcf con -qm SampleQM conn -ap mqpgf APPLTAG CONNOPTS
1: CONN(414D514353616D706C65514D202020205B552CF720004C01) TYPE(CONN) APPLTAG(mqpgf) CONNOPTS(MQCNO_FASTPATH_BINDING)

The connection mode has changed to MQCNO_FASTPATH_BINDING.

fig 6.3


Ex. 6.4 Changing connection mode by MQ_CONNECT_TYPE environment variable

This is valid for MQCONN() or MQCONNX() with MQCNO_STANDARD_BINDING.

CLIENT: Only client connections are attempted.
FASTPATH: This value was supported in previous releases but is currently ignored if specified.
LOCAL: Only server connection is attempted. If the application specifies FASTPATH, it will be downgraded to a normal server connection.
STANDARD: Only for compatibility with previous releases. Currently this value is treated as LOCAL.

Try setting MQ_CONNECT_TYPE to CLIENT to test if client connections are possible with mqpgf linked with the server's library.
*This test is valid only when SampleQM and RemoteQM are created on different machines.

Here, in order to simplify the client connection to SampleQM, once disable the security related parameters as follows.

MQSC > alter qmgr chlauth(disabled) connauth(' ')
3 : alter qmgr chlauth(disabled) connauth(' ')
AMQ8005: IBM MQ queue manager changed.

CONAUTH is a parameter added in MQ 8.0 or higher, and CHLAUTH is a parameter added in MQ 7.1 or higher. After changing, refresh the queue manager's security information.

MQSC > refresh security
7 : refresh security
AMQ8560: IBM MQ security cache refreshed.

Set the default server connection channel mcauser to 'mqm' to allow any user connecting to access with 'mqm' permission. If the queue manager is Windows, set it to 'MUSR_MQADMIN' or a user who belongs to 'mqm' group or 'Administrators' group.

MQSC > alter chl(system.def.svrconn) chltype(svrconn) mcauser('mqm')
5 : alter chl(system.def.svrconn) chltype(svrconn) mcauser('mqm')
AMQ8016: IBM MQ channel changed.

To make sure that the user you want to specify as mcauser has connection to the queue manager and access to the queue, do the following:

>dspmqaut -m SampleQM -t qmgr -p <user name>
Entity <user name> has the following permissions for object SampleQM:
....
connect
....
>dspmqaut -m SampleQM -t queue -p <user name> -n SampleQ
Entity <user name> has the following permissions for object SampleQ:
get
browse
put
....

The connection may fail with 2539 MQRC_CHANNEL_CONFIG_ERROR if code conversion is not possible between the default code page of the MQ client and the CCSID (CodedCharSetId) of the queue manager.

$ mqpgf -qm SampleQM -q SampleQ -x nnn.nnn.nnn.nnn(nnnn) -tr
[2018/07/25 14:22:19.063] MQCONNX start qmgr: SampleQM Options: 0x00000000
[2018/07/25 14:22:19.563] MQCONNX stop qmgr: SampleQM CompCd=02 ReasonCd=2539
MQCONNX fail : SampleQM CompCd=02 ReasonCd=2539
!!! Queue Manager Connect Fail !!!

$ mqrc 2539

2539 0x000009eb MQRC_CHANNEL_CONFIG_ERROR

If this error occurs, temporarily change the CCSID of the queue manager for testing this time. For example, if the MQ client side is Windows, change the CCSID of the queue manager from 819 (ASCII) to 932 (Shift-JIS).
*Formal coping strategies will be explained again at the opportunity.

MQSC > alter qmgr ccsid(932)
2 : alter qmgr ccsid(932)
AMQ8005: IBM MQ queue manager changed.

Although this change appears to take effect immediately, command servers etc. will need to be restarted. Be sure to restart the queue manager for the changes to take effect completely.

Try connecting to SampleQM from the RemoteQM machine. If the environment variable MQ_COONECT_TYPE is not set, mqpgf linked with the server's library will fail with 2059 MQRC_Q_MGR_NOT_AVAILABLE because it will attempt to connect with the bind mode.

>echo %MQ_CONNECT_TYPE%
%MQ_CONNECT_TYPE%

>mqpgf -qm SampleQM -q SampleQ -m test -x nnn.nnn.nnn.nnn(nnnn)
MQCONNX fail : SampleQM CompCd=02 ReasonCd=2059
!!! Queue Manager Connect Fail !!!

>mqrc 2059

2059 0x0000080b MQRC_Q_MGR_NOT_AVAILABLE

Set MQ_CONNECT_TYPE to CLIENT and try again.

>set MQ_CONNECT_TYPE=CLIENT *In the case of Windows
$ export MQ_CONNECT_TYPE=CLIENT *In the case of Unix-like OS

Specify the IP address(listener port) of the connection destination with "-x". For Unix-like operating systems, enclose them in double quotes. Double quotes are not required for Windows.

>mqpgf -qm SampleQM -q SampleQ -x nnn.nnn.nnn.nnn(nnnn) -s MQCLOSE
no message available : SampleQ CompCd=02 ReasonCd=2033
stop before calling MQCLOSE().
Hit Any Key!!!

If you do not specify a channel name, mqpgf connects to SYSTEM.DEF.SVRCONN by default.
Check the channel connection status on the server/Sample QM side as follows.


Test result 6.4

$ mqpcf chs -qm SampleQM -c SYSTEM.DEF.SVRCONN STATUS RAPPLTAG
1: CHLINSTYPE(CURRENT) CHANNEL(SYSTEM.DEF.SVRCONN) STATUS(RUNNING) CHLTYPE(SVRCONN) CONNAME(10.41.207.3) RAPPLTAG(am\win\mqpgf\Debug\mqpgf.exe) STOPREQ(NO) SUBSTATE(RECEIVE)

You can confirm that the mqpgf linked to the library of the server tried a client connection and was able to connect without any problem.

fig 6.4

Reset the environment variables.

>set MQ_CONNECT_TYPE= *In the case of Windows
$ unset MQ_CONNECT_TYPE *In the case of Unix-like OS


Ex. 6.5 Make client connection attempt with MQCNO_CLIENT_BINDING

Specify in the connection option of MQCONNX(). Follow the same procedure as "Ex. 6.4".

>echo %MQ_CONNECT_TYPE%
%MQ_CONNECT_TYPE%

>mqpgf -qm SampleQM -q SampleQ -m test -x nnn.nnn.nnn.nnn(nnnn)
MQCONNX fail : SampleQM CompCd=02 ReasonCd=2059
!!! Queue Manager Connect Fail !!!

Specify MQCNO_CLIENT_BINDING.

>mqpgf -qm SampleQM -q SampleQ -m test -x nnn.nnn.nnn.nnn(nnnn) -s MQCLOSE MQCNO_CLIENT_BINDING
[2018/07/25 16:28:02.594] 1: message length: 4 put message: test
stop before calling MQCLOSE().
Hit Any Key!!!


Test result 6.5

$ mqpcf chs -qm SampleQM -c SYSTEM.DEF.SVRCONN STATUS RAPPLTAG
1: CHLINSTYPE(CURRENT) CHANNEL(SYSTEM.DEF.SVRCONN) STATUS(RUNNING) CHLTYPE(SVRCONN) CONNAME(nnn.nnn.nnn.nnn) RAPPLTAG(am\win\mqpgf\Debug\mqpgf.exe) STOPREQ(NO) SUBSTATE(RECEIVE)

Again, you can see that mqpgf, linked to the server's library, attempted a client connection and successfully connected.

fig 6.5


Ex. 6.6 Example of downgraded FASTPATH

You can downgrade the connection mode of an application with a FASTPATH connection to another server connection by setting the MQ_CONNECT_TYPE environment variable to "LOCAL".

Make sure that a FASTPATH connection is established with MQ_CONNECT_TYPE not set.

$ echo $MQ_CONNECT_TYPE

$ mqpgf -qm SampleQM -q SampleQ -s MQCLOSE MQCNO_FASTPATH_BINDING
no message available : SampleQ CompCd=02 ReasonCd=2033
MQCMIT success : CompCd=00 ReasonCd=00
stop before calling MQCLOSE().
Hit Any Key!!!

$ mqpcf con -qm SampleQM conn -ap mqpgf APPLTAG CONNOPTS
1: CONN(414D514353616D706C65514D202020205B568F0520003401) TYPE(CONN) APPLTAG(mqpgf) CONNOPTS(MQCNO_FASTPATH_BINDING)

Set the MQ_CONNECT_TYPE environment variable to "LOCAL" and try connecting again.

$ export MQ_CONNECT_TYPE=LOCAL
$ echo $MQ_CONNECT_TYPE
LOCAL
$ mqpgf -qm SampleQM -q SampleQ -s MQCLOSE MQCNO_FASTPATH_BINDING
no message available : SampleQ CompCd=02 ReasonCd=2033
MQCMIT success : CompCd=00 ReasonCd=00
stop before calling MQCLOSE().
Hit Any Key!!!


Test result 6.6

$ mqpcf con -qm SampleQM conn -ap mqpgf APPLTAG CONNOPTS
1: CONN(414D514353616D706C65514D202020205B568F0520003307) TYPE(CONN) APPLTAG(mqpgf) CONNOPTS(MQCNO_GUARDIAN_BINDING)

It is downgraded to MQCNO_GUARDIAN_BINDING, the default connection mode for MQ 8 for HP NonStop.

fig 6.6


Ex. 6.7 Server application behavior in MQ client environment

Check the behavior when the application linked with the server library is executed in the environment where only the MQ client is installed.
Check the installation environment.

>dspmqinst
InstName: Installation1
InstDesc:
Identifier: 1
InstPath: C:\Program Files\IBM\MQ
Version: 9.0.3.0
Primary: Yes
State: Available
MSIProdCode: {76218E6C-9695-48DA-BDFB-2E48A9E42CE0}
MSIMedia: 9.0.3 Server
MSIInstanceId: 1

InstName: Installation2
InstDesc:
Identifier: 2
InstPath: C:\Program Files\IBM\MQ_1
Version: 9.1.0.0
Primary: No
State: Available
MSIProdCode: {D210F767-95D5-4AF0-95EE-C3CBA157D68B}
MSIMedia: 9.1 Client
MSIInstanceId: 1

>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 Enterprise x64 Edition, Build 14393
InstName: Installation2
InstDesc:
Primary: No
InstPath: C:\Program Files\IBM\MQ_1
DataPath: C:\ProgramData\IBM\MQ
MaxCmdLevel: 910

Installation2 is used and it is an MQ Client installation.
Run mqpgf linked with the server library.


Test result 6.7

>mqpgf -qm SampleQM -q SampleQ -x 16.147.169.198(18551) -tr -s MQCLOSE
[2018/07/25 18:12:05.193] MQCONNX start qmgr: SampleQM Options: 0x00000000
[2018/07/25 18:12:05.396] MQCONNX stop qmgr: SampleQM CompCd=00 ReasonCd=00
[2018/07/25 18:12:05.396] MQOPEN start ObjectName: SampleQ Options: 0x00000001
[2018/07/25 18:12:05.411] MQOPEN stop ObjectName: SampleQ CompCd=00 ReasonCd=00
[2018/07/25 18:12:05.411] MQGET start Options: 0x00000000
[2018/07/25 18:12:05.443] MQGET stop CompCd=00 ReasonCd=00
[2018/07/25 18:12:05.443] 1: message length: 4 get message : test
stop before calling MQCLOSE().
Hit Any Key!!!

/home/okaqm9/work/cprog/mqpcf: ./mqpcf chs -qm SampleQM -c SYSTEM.DEF.SVRCONN> 1: CHLINSTYPE(CURRENT) CHANNEL(SYSTEM.DEF.SVRCONN) STATUS(RUNNING) CHLTYPE(SVRCONN) CONNAME(10.41.207.3) RAPPLTAG(am\win\mqpgf\Debug\mqpgf.exe) STOPREQ(NO) SUBSTATE(RECEIVE)

However, the client connection is successful. The reason is that if it is linked to the server (mqm) library and the default STANDARD BINDING, it will automatically try to connect to the client if the underlying server library fails to load.

fig 6.7

From some of the tests so far, it is not mandatory to create an application linked to the client library, as the application linked to the server library can also connect to the client.

to the top

Shared (thread independent) connection

There are some restrictions when making an MQ connection from one process.
First, with normal connection options, you can only make one MQ connection from one process or thread. This is a limitation for bind connections, and client connections do not. If you try to make a second connection with MQCONN(), it will fail with 2103 MQRC_ANOTHER_Q_MGR_CONNECTED.
The second is sharing one connection handle with multiple threads. Calling MQOPEN() on another thread using the connection handle obtained from MQCONN() called on the main thread fails with 2018 MQRC_HCONN_ERROR. This constraint is the same for binding and client connections.
A shared (thread independent) connection is provided to enable these two requirements. You can create this type of connection handle with either a binding or client connection.
However, shared (thread-independent) connections are not supported in global units of work with XA transactions, so you need to be aware of that. The fact that it can not be used in a global unit of work means that it is necessary to commit in a local unit of work for each connected queue manager.
*XA transactions and global units of work will be discussed at another time.

The options for shared connection are listed below. Set to Options of the MQCNO structure passed to MQCONNX().

MQCNO_HANDLE_SHARE_NONE 0x00000020 Create a nonshared connection.
MQCNO_HANDLE_SHARE_BLOCK 0x00000040 A shared connection is created, then if the MQI call is using that connection in another thread, it waits for the MQI call to complete.
MQCNO_HANDLE_SHARE_NO_BLOCK 0x00000080 A shared connection is created, then if the MQI call is using that connection in another thread, the MQI call fails with 2219 MQRC_CALL_IN_PROGRESS and returns control immediately.


Ex. 6.8 Connect from a single thread to multiple queue managers

First, check the behavior when connecting from a single thread to multiple queue managers. mqpgf can specify a list of queue managers separated by commas with "-qm". Create a queue with the same name on each of the three queue managers created so far for testing.
This test is valid only if all three queue managers below exist on the same machine.

fig 6.8

$ echo "def ql(LQ1)" | runmqsc SampleQM
$ echo "def ql(LQ1)" | runmqsc RemoteQM
$ echo "def ql(LQ1)" | runmqsc PartialQM

Use MQCNO_HANDLE_SHARE_BLOCK or MQCNO_HANDLE_SHARE_NO_BLOCK for shared connections.
First, confirm the behavior when MQCNO_HANDLE* is not specified or MQCNO_HANDLE_SHARE_NONE is specified. When "-tr" is specified, a simplified API trace is displayed, and it is possible to know how each API is called and the options at the time of the call.


Test result 6.8.1

$ mqpgf -qm SampleQM,RemoteQM,PartialQM -q LQ1 -tr MQCNO_HANDLE_SHARE_NONE
[18/07/26 15:57:17.867751] MQCONNX start qmgr:SampleQM Options:0x00000020
[18/07/26 15:57:17.930701] MQCONNX stop hcon:20971526 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/07/26 15:57:17.930970] MQCONNX start qmgr:RemoteQM Options:0x00000020
[18/07/26 15:57:17.949155] MQCONNX stop hcon:0 qmgr:RemoteQM CompCd=02 ReasonCd=2103
MQCONNX fail : RemoteQM CompCd=02 ReasonCd=2103
!!! Queue Manager Connect Fail RemoteQM !!!

$ mqrc 2103

2103 0x00000837 MQRC_ANOTHER_Q_MGR_CONNECTED

Although 3 queue managers are specified, 2103 MQRC_ANOTHER_Q_MGR_CONNECTED is returned by MQCONNX() in the connection of the second queue manager. Since mqpgf failed to connect, it has ended at that point.

fig 6.9

Try changing to MQCNO_HANDLE_SHARE_BLOCK.


Test result 6.8.2

$ mqpgf -qm SampleQM,RemoteQM,PartialQM -q LQ1 -m test -tr MQCNO_HANDLE_SHARE_BLOCK MQPMO_SYNCPOINT
[18/07/26 16:24:38.817780] MQCONNX start qmgr:SampleQM Options:0x00000040
[18/07/26 16:24:38.876475] MQCONNX stop hcon:20971525 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/07/26 16:24:38.876659] MQCONNX start qmgr:RemoteQM Options:0x00000040
[18/07/26 16:24:38.912757] MQCONNX stop hcon:20971527 qmgr:RemoteQM CompCd=00 ReasonCd=00
[18/07/26 16:24:38.912892] MQCONNX start qmgr:PartialQM Options:0x00000040
[18/07/26 16:24:38.958100] MQCONNX stop hcon:20971529 qmgr:PartialQM CompCd=00 ReasonCd=00
[18/07/26 16:24:38.958741] MQOPEN start hcon:20971525 ObjectName:LQ1 Options:0x00000010
[18/07/26 16:24:38.959152] MQOPEN stop hcon:20971525 ObjectName:LQ1 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.959511] 1: message length: 4 put message: test
[18/07/26 16:24:38.959655] MQPUT start hcon:20971525 Options:0x00000000
[18/07/26 16:24:38.966288] MQPUT stop hcon:20971525 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.966422] MQCMIT start hcon:20971525
[18/07/26 16:24:38.967003] MQCMIT stop hcon:20971525 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/07/26 16:24:38.967198] MQCLOSE start hcon:20971525 Options:0x00000000
[18/07/26 16:24:38.976426] MQCLOSE stop hcon:20971525 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.976530] MQOPEN start hcon:20971527 ObjectName:LQ1 Options:0x00000010
[18/07/26 16:24:38.976956] MQOPEN stop hcon:20971527 ObjectName:LQ1 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.977041] 1: message length: 4 put message: test
[18/07/26 16:24:38.977168] MQPUT start hcon:20971527 Options:0x00000000
[18/07/26 16:24:38.982164] MQPUT stop hcon:20971527 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.982252] MQCMIT start hcon:20971527
[18/07/26 16:24:38.982710] MQCMIT stop hcon:20971527 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/07/26 16:24:38.982838] MQCLOSE start hcon:20971527 Options:0x00000000
[18/07/26 16:24:38.987732] MQCLOSE stop hcon:20971527 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.987812] MQOPEN start hcon:20971529 ObjectName:LQ1 Options:0x00000010
[18/07/26 16:24:38.988205] MQOPEN stop hcon:20971529 ObjectName:LQ1 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.988289] 1: message length: 4 put message: test
[18/07/26 16:24:38.988414] MQPUT start hcon:20971529 Options:0x00000000
[18/07/26 16:24:38.994190] MQPUT stop hcon:20971529 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.994299] MQCMIT start hcon:20971529
[18/07/26 16:24:38.994816] MQCMIT stop hcon:20971529 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/07/26 16:24:38.994947] MQCLOSE start hcon:20971529 Options:0x00000000
[18/07/26 16:24:38.996036] MQCLOSE stop hcon:20971529 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.996115] MQDISC start hcon:20971525
[18/07/26 16:24:38.996454] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.996535] MQDISC start hcon:20971527
[18/07/26 16:24:38.996830] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00
[18/07/26 16:24:38.996917] MQDISC start hcon:20971529
[18/07/26 16:24:39.021688] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00

This time, the connections were successful from a single thread to three queue managers at the same time. You can check the link of each MQI with the connection handle(hcon). mqpgf first connects to all queue managers according to the specified queue manager list. After that, processing from MQOPEN() to MQCLOSE() is performed in the order of the specified queue manager. Finally, MQDISC() is invoked as many as the number of queue managers. *As mentioned above, since there is no global unit of work support, in the case of MQPMO_SYNCPOINT, it is necessary to invoke MQCOMIT() for each queue manager.

fig 6.10


Ex. 6.9 Sharing connection handles among threads

Next, check the sharing of connection handles between threads. First, check what happens when the shared connection is not used. mqpgf can specify the number of threads started after "-nt". In this case, the connection handle is created on the main thread and MQI() other than MQDISC() is called on the specified number of child threads using that handle. The connection in this example is a client binding.


Test result 6.9.1

>mqpgf -qm SampleQM -q SampleQ -m test -x nnn.nnn.nnn.nnn(nnnn) MQCNO_CLIENT_BINDING -nt 3 -tr
[2018/07/26 18:02:43.975 tid=0] MQCONNX start qmgr:SampleQM Options:0x00000800
[2018/07/26 18:02:44.116 tid=0] MQCONNX stop hcon:33554438 qmgr:SampleQM CompCd=00 ReasonCd=00
[2018/07/26 18:02:44.131 tid=35720] MQOPEN start hcon:33554438 ObjectName:SampleQ Options:0x00000010
[2018/07/26 18:02:44.131 tid=36484] MQOPEN start hcon:33554438 ObjectName:SampleQ Options:0x00000010
[2018/07/26 18:02:44.131 tid=33496] MQOPEN start hcon:33554438 ObjectName:SampleQ Options:0x00000010
[2018/07/26 18:02:44.131 tid=35720] MQOPEN stop hcon:33554438 ObjectName:SampleQ CompCd=02 ReasonCd=2018
[2018/07/26 18:02:44.131 tid=36484] MQOPEN stop hcon:33554438 ObjectName:SampleQ CompCd=02 ReasonCd=2018
MQOPEN fail : SampleQM SampleQ CompCd=02 ReasonCd=2018
MQOPEN fail : SampleQM SampleQ CompCd=02 ReasonCd=2018
[2018/07/26 18:02:44.131 tid=33496] MQOPEN stop hcon:33554438 ObjectName:SampleQ CompCd=02 ReasonCd=2018
MQOPEN fail : SampleQM SampleQ CompCd=02 ReasonCd=2018
[2018/07/26 18:02:44.147 tid=0] MQDISC start hcon:33554438
[2018/07/26 18:02:44.163 tid=0] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00

>mqrc 2018

2018 0x000007e2 MQRC_HCONN_ERROR

MQCONNX() is called in the main thread("tid = 0") and connection has been completed successfully. Three child threads("tid = 35720", "tid = 36484", "tid = 33496") call MQOPEN() using the connection handle, but they all ended abnormally with 2018 MQRC_HCONN_ERROR. If you specify MQCNO_HANDLE_SHARE_NO_BLOCK, mqpgf does not retry the MQI call if 22219 MQRC_CALL_IN_PROGRESS is returned. Therefore, only MQCNO_HANDLE_SHARE_BLOCK is actually effective when specifying MQI calls in multiple threads.

fig 6.11

Try specifying MQCNO_HANDLE_SHARE_BLOCK.


Test result 6.9.2

>mqpgf -qm SampleQM -q SampleQ -m test -x nnn.nnn.nnn.nnn(nnnn) MQCNO_CLIENT_BINDING -nt 3 -tr MQCNO_HANDLE_SHARE_BLOCK
[2018/07/26 18:19:10.208 tid=0] MQCONNX start qmgr:SampleQM Options:0x00000840
[2018/07/26 18:19:10.333 tid=0] MQCONNX stop hcon:33554437 qmgr:SampleQM CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.333 tid=31108] MQOPEN start hcon:33554437 ObjectName:SampleQ Options:0x00000010
[2018/07/26 18:19:10.333 tid=38164] MQOPEN start hcon:33554437 ObjectName:SampleQ Options:0x00000010
[2018/07/26 18:19:10.333 tid=38156] MQOPEN start hcon:33554437 ObjectName:SampleQ Options:0x00000010
[2018/07/26 18:19:10.333 tid=31108] MQOPEN stop hcon:33554437 ObjectName:SampleQ CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.333 tid=31108] 1: message length: 4 put message: test
[2018/07/26 18:19:10.349 tid=38164] MQOPEN stop hcon:33554437 ObjectName:SampleQ CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.349 tid=31108] MQPUT start hcon:33554437 Options:0x00000000
[2018/07/26 18:19:10.349 tid=38156] MQOPEN stop hcon:33554437 ObjectName:SampleQ CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.349 tid=38164] 1: message length: 4 put message: test
[2018/07/26 18:19:10.365 tid=38164] MQPUT start hcon:33554437 Options:0x00000000
[2018/07/26 18:19:10.365 tid=38156] 1: message length: 4 put message: test
[2018/07/26 18:19:10.365 tid=38156] MQPUT start hcon:33554437 Options:0x00000000
[2018/07/26 18:19:10.380 tid=31108] MQPUT stop hcon:33554437 CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.380 tid=31108] MQCLOSE start hcon:33554437 Options:0x00000000
[2018/07/26 18:19:10.396 tid=38164] MQPUT stop hcon:33554437 CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.396 tid=38164] MQCLOSE start hcon:33554437 Options:0x00000000
[2018/07/26 18:19:10.396 tid=38156] MQPUT stop hcon:33554437 CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.396 tid=38156] MQCLOSE start hcon:33554437 Options:0x00000000
[2018/07/26 18:19:10.412 tid=31108] MQCLOSE stop hcon:33554437 CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.427 tid=38164] MQCLOSE stop hcon:33554437 CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.443 tid=38156] MQCLOSE stop hcon:33554437 CompCd=00 ReasonCd=00
[2018/07/26 18:19:10.458 tid=0] MQDISC start hcon:33554437
[2018/07/26 18:19:10.490 tid=0] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00

Three threads share one connection handle and complete processing without error.

fig 6.12

In addition to "-nt", there is also an option "-ni" as an option to execute processing in multi-thread in mqpgf. "-nt" shares the connection handle created in the main thread among the child threads, but if "-ni" is specified, MQCONN()/MQCONNX() and MQDISC() are called in the child thread started from the main thread. In this case, it is not necessary to create a "shared(thread independent) connection"(specify MQCNO_HANDLE_SHARE_BLOCK).
Check it just in case.


Test result 6.9.3

$ mqpgf -qm SampleQM -q SampleQ -m "thread test" -ni 3 -tr MQPMO_SYNCPOINT
[18/08/07 17:56:12.161562 tid=44144] MQCONN start qmgr:SampleQM
[18/08/07 17:56:12.163679 tid=47424] MQCONN start qmgr:SampleQM
[18/08/07 17:56:12.163723 tid=50704] MQCONN start qmgr:SampleQM
[18/08/07 17:56:12.284938 tid=44144] MQCONN stop hcon:20971526 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/08/07 17:56:12.285045 tid=44144] MQOPEN start hcon:20971526 ObjectName:SampleQ Options:0x00000010
[18/08/07 17:56:12.285394 tid=44144] MQOPEN stop hcon:20971526 ObjectName:SampleQ CompCd=00 ReasonCd=00
[18/08/07 17:56:12.285453 tid=44144] 1: message length: 11 put message: thread test
[18/08/07 17:56:12.285557 tid=44144] MQPUT start hcon:20971526 Options:0x00000000
[18/08/07 17:56:12.300966 tid=47424] MQCONN stop hcon:20971528 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/08/07 17:56:12.301005 tid=47424] MQOPEN start hcon:20971528 ObjectName:SampleQ Options:0x00000010
[18/08/07 17:56:12.308055 tid=50704] MQCONN stop hcon:20971530 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/08/07 17:56:12.308091 tid=50704] MQOPEN start hcon:20971530 ObjectName:SampleQ Options:0x00000010
[18/08/07 17:56:12.308375 tid=44144] MQPUT stop hcon:20971526 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.308421 tid=44144] MQCMIT start hcon:20971526
[18/08/07 17:56:12.308476 tid=47424] MQOPEN stop hcon:20971528 ObjectName:SampleQ CompCd=00 ReasonCd=00
[18/08/07 17:56:12.308536 tid=47424] 1: message length: 11 put message: thread test
[18/08/07 17:56:12.308581 tid=47424] MQPUT start hcon:20971528 Options:0x00000000
[18/08/07 17:56:12.308634 tid=50704] MQOPEN stop hcon:20971530 ObjectName:SampleQ CompCd=00 ReasonCd=00
[18/08/07 17:56:12.308673 tid=50704] 1: message length: 11 put message: thread test
[18/08/07 17:56:12.308707 tid=50704] MQPUT start hcon:20971530 Options:0x00000000
[18/08/07 17:56:12.308753 tid=47424] MQPUT stop hcon:20971528 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.308787 tid=47424] MQCMIT start hcon:20971528
[18/08/07 17:56:12.308830 tid=50704] MQPUT stop hcon:20971530 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.308870 tid=50704] MQCMIT start hcon:20971530
[18/08/07 17:56:12.309450 tid=44144] MQCMIT stop hcon:20971526 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/08/07 17:56:12.309516 tid=44144] MQCLOSE start hcon:20971526 Options:0x00000000
[18/08/07 17:56:12.309560 tid=47424] MQCMIT stop hcon:20971528 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/08/07 17:56:12.309618 tid=47424] MQCLOSE start hcon:20971528 Options:0x00000000
[18/08/07 17:56:12.309660 tid=50704] MQCMIT stop hcon:20971530 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/08/07 17:56:12.309716 tid=50704] MQCLOSE start hcon:20971530 Options:0x00000000
[18/08/07 17:56:12.309758 tid=44144] MQCLOSE stop hcon:20971526 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.309791 tid=44144] MQDISC start hcon:20971526
[18/08/07 17:56:12.309835 tid=47424] MQCLOSE stop hcon:20971528 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.309866 tid=47424] MQDISC start hcon:20971528
[18/08/07 17:56:12.315516 tid=50704] MQCLOSE stop hcon:20971530 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.315556 tid=50704] MQDISC start hcon:20971530
[18/08/07 17:56:12.316555 tid=44144] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.317559 tid=47424] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00
[18/08/07 17:56:12.321606 tid=50704] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00

$ mqpgf -qm SampleQM -q SampleQ -ni 3 -tr MQGMO_SYNCPOINT
[18/08/07 17:56:19.812864 tid=44144] MQCONN start qmgr:SampleQM
[18/08/07 17:56:19.814992 tid=47424] MQCONN start qmgr:SampleQM
[18/08/07 17:56:19.815036 tid=50704] MQCONN start qmgr:SampleQM
[18/08/07 17:56:19.936089 tid=44144] MQCONN stop hcon:20971526 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/08/07 17:56:19.936178 tid=44144] MQOPEN start hcon:20971526 ObjectName:SampleQ Options:0x00000001
[18/08/07 17:56:19.936448 tid=44144] MQOPEN stop hcon:20971526 ObjectName:SampleQ CompCd=00 ReasonCd=00
[18/08/07 17:56:19.936496 tid=44144] MQGET start hcon:20971526 Options:0x00000000
[18/08/07 17:56:19.936588 tid=47424] MQCONN stop hcon:20971528 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/08/07 17:56:19.936624 tid=47424] MQOPEN start hcon:20971528 ObjectName:SampleQ Options:0x00000001
[18/08/07 17:56:19.936696 tid=50704] MQCONN stop hcon:20971530 qmgr:SampleQM CompCd=00 ReasonCd=00
[18/08/07 17:56:19.936731 tid=50704] MQOPEN start hcon:20971530 ObjectName:SampleQ Options:0x00000001
[18/08/07 17:56:19.949521 tid=44144] MQGET stop hcon:20971526 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.949560 tid=44144] 1: message length: 4 get message : test
[18/08/07 17:56:19.949636 tid=44144] MQCMIT start hcon:20971526
[18/08/07 17:56:19.949686 tid=47424] MQOPEN stop hcon:20971528 ObjectName:SampleQ CompCd=00 ReasonCd=00
[18/08/07 17:56:19.949757 tid=47424] MQGET start hcon:20971528 Options:0x00000000
[18/08/07 17:56:19.949820 tid=50704] MQOPEN stop hcon:20971530 ObjectName:SampleQ CompCd=00 ReasonCd=00
[18/08/07 17:56:19.949866 tid=50704] MQGET start hcon:20971530 Options:0x00000000
[18/08/07 17:56:19.949924 tid=47424] MQGET stop hcon:20971528 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.949959 tid=47424] 1: message length: 4 get message : test
[18/08/07 17:56:19.949996 tid=47424] MQCMIT start hcon:20971528
[18/08/07 17:56:19.950041 tid=50704] MQGET stop hcon:20971530 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.950083 tid=50704] 1: message length: 4 get message : test
[18/08/07 17:56:19.950118 tid=50704] MQCMIT start hcon:20971530
[18/08/07 17:56:19.950521 tid=44144] MQCMIT stop hcon:20971526 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/08/07 17:56:19.950600 tid=44144] MQCLOSE start hcon:20971526 Options:0x00000000
[18/08/07 17:56:19.950649 tid=47424] MQCMIT stop hcon:20971528 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/08/07 17:56:19.950714 tid=47424] MQCLOSE start hcon:20971528 Options:0x00000000
[18/08/07 17:56:19.950761 tid=50704] MQCMIT stop hcon:20971530 CompCd=00 ReasonCd=00
MQCMIT success : CompCd=00 ReasonCd=00
[18/08/07 17:56:19.950825 tid=50704] MQCLOSE start hcon:20971530 Options:0x00000000
[18/08/07 17:56:19.950871 tid=44144] MQCLOSE stop hcon:20971526 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.950908 tid=44144] MQDISC start hcon:20971526
[18/08/07 17:56:19.950955 tid=47424] MQCLOSE stop hcon:20971528 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.950989 tid=47424] MQDISC start hcon:20971528
[18/08/07 17:56:19.956575 tid=50704] MQCLOSE stop hcon:20971530 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.956619 tid=50704] MQDISC start hcon:20971530
[18/08/07 17:56:19.957617 tid=44144] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.958623 tid=47424] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00
[18/08/07 17:56:19.962197 tid=50704] MQDISC stop hcon:-1 CompCd=00 ReasonCd=00

*"-nt", "-ni" do not available to MQ 5.3. Also, "Shared (thread independent) connection" is not supported by MQ5.3 for HP NonStop.

fig 6.13

to the top

to the top