Japanese

Practical mastering IBM MQ basics

Message descriptor (MQMD V2) (2)

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


Segmentation of messages with MQRFH2 header

If MQRFH2 headers or other headers are used for MQ messages, there are some caveats when doing segmentation or grouping in an application. The following describes MQRFH2 as an example. The MQRFH2 header is a header used when dealing with MQ message properties and JMS properties, but more details on its own will be introduced at another time.


Notes on segment size

If you want the queue manager to segment by specifying MQMF_SEGMENTATION_ALLOWED, the size divided into segments must be larger than MQRFH2. If the size of MQRFH2 is larger than the segmented size, MQPUT() fails with MQRC_MSG_TOO_BIG_FOR_Q(2030). The MQRFH2 header is variable in length, so let me tell you this just in case. In practice, it is rare to segment with a size smaller than the MQRFH2 header, or use an MQRFH2 header larger than the size you want to segment. It is unlikely that this will occur unless it is in a very special situation.

To create a message with an MQRFH2 header added by mqpgf, specify one or more field values of the MQRFH2 header with the following options.

$ mqpgf
....
MQRFH2 fields:
-re : Encoding( or MQENC_*)
-rc : CodedCharSetId( or MQCCSI_*)
-rf : Format(e.g. -rf MQFMT_STRING)
-fg : Flags -nc : NameValueCCSID( or MQCCSI_*)
-nd : NameValueData(e.g. -nd "data1,data2,data3")
....


Ex. 5.1 Example of segmentation failure of message with RFH header

"-nd": Try to put a message with specifying data of arbitrary XML format in NameValueData.

$ mqpgf -qm SampleQM -q SampleQ -m "RFH2 Segmentation" -nd "value67890123456789012345678901234567890" MQFMT_RF_HEADER_2 MQMF_SEGMENTATION_ALLOWED MQMD_VERSION_2
[18/06/11 15:42:03] 1: message length: 17 put message: RFH2 Segmentation

*Option descriptions
-nd: Set specified data as NameValude data of MQRFH2 header
MQFMT_RF_HEADER_2: Set MQMD.Format to MQFMT_RF_HEADER_2
MQMF_SEGMENTATION_ALLOWED: Set MQMF_SEGMENTATION_ALLOWED of MQMD.MsgFlags

When dumping in verbose mode with "-dpv" or "-brv", the MQRFH2 header will be displayed in an easy-to-read format similar to MQMD.

$ mqpgf -qm SampleQM -q SampleQ -dpv
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[MQHRF2 ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20002907] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[06420393] ApplOriginData[ ]

GroupId[0x000000000000000000000000000000000000000000000000] MsgSeqNumber[1] Offset[0] MsgFlags[0] OriginalLength[-1]

*StrucId[RFH ] Version[2] StrucLength[104] Encoding[273] CodedCharSetId[943] Format[ ] Flags[0] NameValueCCSID[1208]
NameValueLength[64] NameValueData[value67890123456789012345678901234567890 ]
data length: 121
00000000: 5246 4832 2053 6567 6D65 6E74 6174 696F 'RFH2 Segmentatio'
00000010: 6E 'n '

The value of MQRFH2.StrucLength is the length of the entire MQRFH2 header including NameValueData. In this example it is 104 bytes. Try setting the queue's MAXMSGL to be smaller than this length, 100, and segmenting with the queue manager.


Test result 5.1.1

$ echo "alter ql('SampleQ') MAXMSGL(100)" | runmqsc SampleQM
....

$ mqpgf -qm SampleQM -q SampleQ -m "RFH2 Segmentation" -nd "value67890123456789012345678901234567890" MQFMT_RF_HEADER_2 MQMF_SEGMENTATION_ALLOWED MQMD_VERSION_2

[18/06/11 16:00:12] 1: message length: 17 put message: RFH2 Segmentation
MQPUT fail : SampleQ CompCd=02 ReasonCd=2030

$ mqrc 2030

2030 0x000007ee MQRC_MSG_TOO_BIG_FOR_Q

$ echo "alter ql('SampleQ') MAXMSGL(4194304)" | runmqsc SampleQM
....

MQPUT() fails with MQRC_MSG_TOO_BIG_FOR_Q(2030).

fig 5.1

When segmentation by application under similar conditions, MQRC_HEADER_ERROR(2142) fails because the MQRFH2 header becomes incomplete.


Test result 5.1.2

$ mqpgf -qm SampleQM -q SampleQ -m "RFH2 Segmentation" -as 100 -nd "value67890123456789012345678901234567890" MQFMT_RF_HEADER_2 MQMD_VERSION_2
[18/06/11 17:51:52] 1: message length: 17 put message: RFH2 Segmentation
[18/06/11 17:51:52] 1: logical message: 1 length: 121 put message: RFH .......h........ ...........@value67890123456789012345678901234567890 RFH2 Segmentation
[18/06/11 17:51:52] 1: segment: 1 length: 100 put message: RFH .......h........ ...........@value67890123456789012345678901234567890
$ mqrc 2142

2142 0x0000085e MQRC_HEADER_ERROR

Please change conditions and try variously.

fig 5.2


Notes on setting CodedCharSetId, Encoding, Format

Note that if the MQRFH2 header is used, the MQMD CodedCharSetId, Encoding, Format is not user data, but represents the respective format for MQRFH2. And each format for user data is specified not by MQMD but by CodedCharSetId, Encoding, Format of MQRFH2 which is the previous header. When segmenting with the queue manager, the queue manager automatically sets the CodedCharSetId, Encoding, and Format of the MQRFH2 header to CodedCharSetId, Encoding, and Format of the second and subsequent MQMDs that do not include the MQRFH2 header. If the application splits the message, the application must do this.


Ex. 5.2 Segment the message with RFH header to the queue manager

First, let Qmgr perform segmentation and check it.

$ echo "alter ql('SampleQ') MAXMSGL(200)" | runmqsc SampleQM
....
$ mqpgf -qm SampleQM -q SampleQ -f largemsg.txt -nd "value67890123456789012345678901234567890" MQFMT_RF_HEADER_2 MQMF_SEGMENTATION_ALLOWED MQMD_VERSION_2 -rc 932 -re 546 -rf MQFMT_STRING
[18/06/11 16:32:50] 1: put from: largemsg.txt

*Option descriptions
-nd: Set specified data as NameValude data of MQRFH2 header
MQFMT_RF_HEADER_2: Set MQMD.Format to MQFMT_RF_HEADER_2
MQMF_SEGMENTATION_ALLOWED: Set MQMF_SEGMENTATION_ALLOWED of MQMD.MsgFlags


Test result 5.2

$ mqpgf -qm SampleQM -q SampleQ -dpv -r
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[MQHRF2 ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003302] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[07325079] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003303] MsgSeqNumber[1] Offset[0] MsgFlags[3] OriginalLength[192]

*StrucId[RFH ] Version[2] StrucLength[104] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Flags[0] NameValueCCSID[1208]
NameValueLength[64] NameValueData[value67890123456789012345678901234567890 ]
data length: 192
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 0A31 'mnopqrstuvqxyz.1'
00000040: 3233 3435 3637 3839 3041 4243 4445 4647 '234567890ABCDEFG'
00000050: 4849 4A4B 4C4D 4E4F 'HIJKLMNO '

message number: 2 *StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003304] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[07325079] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003303] MsgSeqNumber[1] Offset[192] MsgFlags[3] OriginalLength[192]

data length: 192
00000000: 5051 5253 5455 5657 5859 5A61 6263 6465 'PQRSTUVWXYZabcde'
00000010: 6667 6869 6A6B 6C6D 6E6F 7071 7273 7475 'fghijklmnopqrstu'
00000020: 7671 7879 7A0A 3132 3334 3536 3738 3930 'vqxyz.1234567890'
00000030: 4142 4344 4546 4748 494A 4B4C 4D4E 4F50 'ABCDEFGHIJKLMNOP'
00000040: 5152 5354 5556 5758 595A 6162 6364 6566 'QRSTUVWXYZabcdef'
00000050: 6768 696A 6B6C 6D6E 6F70 7172 7374 7576 'ghijklmnopqrstuv'
00000060: 7178 797A 0A31 3233 3435 3637 3839 3041 'qxyz.1234567890A'
00000070: 4243 4445 4647 4849 4A4B 4C4D 4E4F 5051 'BCDEFGHIJKLMNOPQ'
00000080: 5253 5455 5657 5859 5A61 6263 6465 6667 'RSTUVWXYZabcdefg'
00000090: 6869 6A6B 6C6D 6E6F 7071 7273 7475 7671 'hijklmnopqrstuvq'
000000A0: 7879 7A0A 3132 3334 3536 3738 3930 4142 'xyz.1234567890AB'
000000B0: 4344 4546 4748 494A 4B4C 4D4E 4F50 5152 'CDEFGHIJKLMNOPQR'

message number: 3
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003305] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[07325079] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003303] MsgSeqNumber[1] Offset[384] MsgFlags[7] OriginalLength[35]

data length: 35
00000000: 5354 5556 5758 595A 6162 6364 6566 6768 'STUVWXYZabcdefgh'
00000010: 696A 6B6C 6D6E 6F70 7172 7374 7576 7178 'ijklmnopqrstuvqx'
00000020: 797A 0A 'yz. '

no message available : SampleQ CompCd=02 ReasonCd=2033

The value of each field set in the first MQMD is the default of the machine tested. You can confirm that the value specified in the MQRFH2 header is used for the MQMD field of the second and subsequent messages.

place Encoding  CodedCharSetId Format
MQMD of the top message 273 943 "MQHRF2 "
MQRFH2 header 546 932 "MQSTR "
MQMD for the second and subsequent messages 546 932 "MQSTR "

fig 5.3

As introduced earlier, mqpgf can split a given message into multiple logical messages. At this time, if you specify items in the MQRFH2 header, mqpgf appends the MQRFH2 header only to the first logical message. Therefore, if the second and subsequent logical messages are segmented by the queue manager, the CodedCharSetId, Encoding, and Format of the MQRFH2 header are not copied to the segment MQMD. This is of course because the logical message being segmented does not have the MQRFH2 header. If the user's application does the same processing, it will be necessary for the application to copy the CodedCharSetId, Encoding, and Format of the MQRFH2 header to the MQMD of the second and subsequent logical messages. mqpgf does this when creating grouped logical messages and when the application (mqpgf itself) performs segmentation.

*Applying this process to grouped logical messages is due to special requirements in the mqpgf specification of creating grouped messages by dividing a message. In general, use caution when performing segmentation in an application.


Ex. 5.3 Grouping and Segmentation with RFH Header in the First Logical Message

Add RFH2 to the following data, set the line feed as the logical group delimiter (-dl 0x0a), and try segmenting with 100 bytes (-as 100) by the application.

$ cat largemsg3.txt
1234567890
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz12345678901234567890123456789012345678901234567890
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz

$ mqpgf -qm SampleQM -q SampleQ -f largemsg3.txt -dl 0x0a -as 100 MQMD_VERSION_2 MQPMO_LOGICAL_ORDER MQPMO_SYNCPOINT MQFMT_RF_HEADER_2 -nd "value67890" -rc 932 -re 546 -rf MQFMT_STRING
[18/06/11 18:06:11] 1: put from: largemsg3.txt
[18/06/11 18:06:11] 1: logical message: 1 length: 86 put message: RFH .......L..."....MQSTR ...........$value67890 1234567890
[18/06/11 18:06:11] 1: logical message: 2 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/11 18:06:11] 1: logical message: 3 length: 112 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz12345678901234567890123456789012345678901234567890
[18/06/11 18:06:11] 1: segment: 1 length: 100 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz12345678901234567890123456789012345678
[18/06/11 18:06:11] 1: segment: 2 length: 12 put message: 901234567890
[18/06/11 18:06:11] 1: logical message: 4 length: 36 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
[18/06/11 18:06:11] 1: logical message: 5 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
MQCMIT success : CompCd=00 ReasonCd=00


Test result 5.3

$ mqpgf -qm SampleQM -q SampleQ -dpv -r
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[MQHRF2 ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003B03] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[09061145] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003B04] MsgSeqNumber[1] Offset[0] MsgFlags[8] OriginalLength[-1]

*StrucId[RFH ] Version[2] StrucLength[76] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Flags[0] NameValueCCSID[1208]
NameValueLength[36] NameValueData[value67890 ]
data length: 86
00000000: 3132 3334 3536 3738 3930 '1234567890 '

message number: 2
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003B05] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[09061146] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003B04] MsgSeqNumber[2] Offset[0] MsgFlags[8] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 3
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003B06] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[09061146] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003B04] MsgSeqNumber[3] Offset[0] MsgFlags[10] OriginalLength[100]

data length: 100
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 3132 'mnopqrstuvqxyz12'
00000040: 3334 3536 3738 3930 3132 3334 3536 3738 '3456789012345678'
00000050: 3930 3132 3334 3536 3738 3930 3132 3334 '9012345678901234'
00000060: 3536 3738 '5678 '

message number: 4
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003B07] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[09061146] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003B04] MsgSeqNumber[3] Offset[100] MsgFlags[14] OriginalLength[12]

data length: 12
00000000: 3930 3132 3334 3536 3738 3930 '901234567890 '

message number: 5
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003B08] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[09061146] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003B04] MsgSeqNumber[4] Offset[0] MsgFlags[8] OriginalLength[-1]

data length: 36
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 'WXYZ '

message number: 6
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[546] CodedCharSetId[932] Format[MQSTR ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B1E078C20003B09] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180611] PutTime[09061146] ApplOriginData[ ]

GroupId[0x414D512053616D706C65514D202020205B1E078C20003B04] MsgSeqNumber[5] Offset[0] MsgFlags[24] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

no message available : SampleQ CompCd=02 ReasonCd=2033

CodedCharSetId, Encoding, and Format of MQRFH2 header are set in MQMD of all logical messages and segments except the first physical message.

fig 5.4

to the top

How to read a message by specifying a specific logical message of a specific group and/or a specific segment

A specific physical message can be read specified by specifying GroupId, MsgSeqNumber, and Offset of MQMD V2.
The following match options are available when using MQGMO_VERSION_2:

First message in queue MQMO_NONE
First message matching MsgId MQMO_MATCH_MSG_ID
First message matching CorrelId MQMO_MATCH_CORREL_ID
First message matching GroupId MQMO_MATCH_GROUP_ID
First message that matches MsgSeqNumber MQMO_MATCH_MSG_SEQ_NUMBER
First message matching MsgToken MQMO_MATCH_MSG_TOKEN
First message matching Offset MQMO_MATCH_OFFSET


Ex. 5.4 Read with specifying a specific group, logical message, or segment

By calling MQGET() with MQMO_MATCH_GROUP_ID, MQMO_MATCH_MSG_SEQ_NUMBER, MQMO_MATCH_OFFSET specified, you can get the messages in logical order as you would with MQGMO_LOGICAL_ORDER.

Try to randomly put the physical messages of two groups in the same way as "Ex. 4.7 Retrieving group messages in logical order".

$ mqpgf -qm SampleQM -q SampleQ -m Group2Logical2Segment2 -gi GroupId2 -ms 2 -of 22 MQMD_VERSION_2 MQMF_LAST_SEGMENT MQMF_LAST_MSG_IN_GROUP
[18/05/29 15:57:11] 1: message length: 22 put message: Group2Logical2Segment2
$ mqpgf -qm SampleQM -q SampleQ -m Group1Logical3Segment2 -gi GroupId1 -ms 3 -of 22 MQMD_VERSION_2 MQMF_LAST_SEGMENT MQMF_LAST_MSG_IN_GROUP
[18/05/29 15:57:41] 1: message length: 22 put message: Group1Logical3Segment2
$ mqpgf -qm SampleQM -q SampleQ -m Group2Logical2Segment1 -gi GroupId2 -ms 2 -of 0 MQMD_VERSION_2 MQMF_SEGMENT MQMF_LAST_MSG_IN_GROUP
[18/05/29 15:57:54] 1: message length: 22 put message: Group2Logical2Segment1
$ mqpgf -qm SampleQM -q SampleQ -m Group1Logical3Segment1 -gi GroupId1 -ms 3 -of 0 MQMD_VERSION_2 MQMF_SEGMENT MQMF_LAST_MSG_IN_GROUP
[18/05/29 15:58:08] 1: message length: 22 put message: Group1Logical3Segment1
$ mqpgf -qm SampleQM -q SampleQ -m Group1Logical2 -gi GroupId1 -ms 2 MQMD_VERSION_2 MQMF_MSG_IN_GROUP
[18/05/29 15:58:27] 1: message length: 14 put message: Group1Logical2
$ mqpgf -qm SampleQM -q SampleQ -m Group1Logical1Segment2 -gi GroupId1 -ms 1 -of 22 MQMD_VERSION_2 MQMF_LAST_SEGMENT MQMF_MSG_IN_GROUP
[18/05/29 15:58:41] 1: message length: 22 put message: Group1Logical1Segment2
$ mqpgf -qm SampleQM -q SampleQ -m Group2Logical1 -gi GroupId2 -ms 1 MQMD_VERSION_2 MQMF_MSG_IN_GROUP
[18/05/29 15:58:53] 1: message length: 14 put message: Group2Logical1
$ mqpgf -qm SampleQM -q SampleQ -m Group1Logical1Segment1 -gi GroupId1 -ms 1 -of 0 MQMD_VERSION_2 MQMF_SEGMENT MQMF_MSG_IN_GROUP
[18/05/29 16:02:41] 1: message length: 22 put message: Group1Logical1Segment1

Get messages in order while specifying GroupId, MsgSeqNumber, Offset.


Test result 5.4

$ mqpgf -qm SampleQM -q SampleQ -dpv -gi GroupId1 MQMO_MATCH_GROUP_ID -ms 1 MQMO_MATCH_MSG_SEQ_NUMBER -of 0 MQMO_MATCH_OFFSET MQMD_VERSION_2 MQGMO_VERSION_2
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B0CF7E320002403] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180529] PutTime[07024120] ApplOriginData[ ]

GroupId[0x47726F757049643100000000000000000000000000000000] MsgSeqNumber[1] Offset[0] MsgFlags[10] OriginalLength[22]

data length: 22
00000000: 4772 6F75 7031 4C6F 6769 6361 6C31 5365 'Group1Logical1Se'
00000010: 676D 656E 7431 'gment1 '

$ mqpgf -qm SampleQM -q SampleQ -dpv -gi GroupId1 MQMO_MATCH_GROUP_ID -ms 1 MQMO_MATCH_MSG_SEQ_NUMBER -of 22 MQMO_MATCH_OFFSET MQMD_VERSION_2 MQGMO_VERSION_2
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B0CF7E320002332] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180529] PutTime[06584183] ApplOriginData[ ]

GroupId[0x47726F757049643100000000000000000000000000000000] MsgSeqNumber[1] Offset[22] MsgFlags[14] OriginalLength[22]

data length: 22
00000000: 4772 6F75 7031 4C6F 6769 6361 6C31 5365 'Group1Logical1Se'
00000010: 676D 656E 7432 'gment2 '

$ mqpgf -qm SampleQM -q SampleQ -dpv -gi GroupId1 MQMO_MATCH_GROUP_ID -ms 2 MQMO_MATCH_MSG_SEQ_NUMBER -of 0 MQMO_MATCH_OFFSET MQMD_VERSION_2 MQGMO_VERSION_2
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B0CF7E320002330] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180529] PutTime[06582712] ApplOriginData[ ]

GroupId[0x47726F757049643100000000000000000000000000000000] MsgSeqNumber[2] Offset[0] MsgFlags[8] OriginalLength[-1]

data length: 14
00000000: 4772 6F75 7031 4C6F 6769 6361 6C32 'Group1Logical2 '

$ mqpgf -qm SampleQM -q SampleQ -dpv -gi GroupId1 MQMO_MATCH_GROUP_ID -ms 3 MQMO_MATCH_MSG_SEQ_NUMBER -of 0 MQMO_MATCH_OFFSET MQMD_VERSION_2 MQGMO_VERSION_2
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B0CF7E32000232E] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180529] PutTime[06580859] ApplOriginData[ ]

GroupId[0x47726F757049643100000000000000000000000000000000] MsgSeqNumber[3] Offset[0] MsgFlags[26] OriginalLength[22]

data length: 22
00000000: 4772 6F75 7031 4C6F 6769 6361 6C33 5365 'Group1Logical3Se'
00000010: 676D 656E 7431 'gment1 '

$ mqpgf -qm SampleQM -q SampleQ -dpv -gi GroupId1 MQMO_MATCH_GROUP_ID -ms 3 MQMO_MATCH_MSG_SEQ_NUMBER -of 22 MQMO_MATCH_OFFSET MQMD_VERSION_2 MQGMO_VERSION_2
message number: 1
*StrucId[MD ] Version[2] Report[0] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[943] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512053616D706C65514D202020205B0CF7E32000232A] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[SampleQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180529] PutTime[06574153] ApplOriginData[ ]

GroupId[0x47726F757049643100000000000000000000000000000000] MsgSeqNumber[3] Offset[22] MsgFlags[30] OriginalLength[22]

data length: 22
00000000: 4772 6F75 7031 4C6F 6769 6361 6C33 5365 'Group1Logical3Se'
00000010: 676D 656E 7432 'gment2 '

The physical message of "GropuId1" can be read in logical order regardless of arrival order.

fig 5.5

to the top

MQ cluster and group messages and segmentation


Fixing the destination of the same group logical messages

When configuring an MQ cluster environment, you may want to send messages belonging to the same group to the same destination. You can use the MQOO_BIND_ON_GROUP option with MQOPEN() to distribute the load among cluster queues with the same name in group units. You can use MQOO_BIND_ON_OPEN (the default behavior), but using this option causes the destination to be fixed when you invoke MQOPEN(), so you need to reopen the cluster queue for each group. With MQOO_BIND_NOT_FIXED, workload balancing results in the same group of logical messages being sent to different destinations.


(Create MQ cluster configuration)

Add settings to an existing test environment to create a simple cluster environment. The normal distributed queuing environment (using SDR / RCVR channels etc.) and the MQ cluster configuration can coexist without problems. Make both SampleQM and RemoteQM a full repository queue manager with cluster name "PLSRCLUS". Within the MQ cluster, we need to create two full repository queue managers. Newly create PartialQM as a partial repository queue manager.

fig 5.6

<< Working with SampleQM >>

Specify a cluster name in the repos property of qmgr, and create a cluster receiver channel. Note that the connection name specified in conname specifies the content that points to itself. Although it may seem confusing, the automatically defined CLUSSDR channel uses the attributes of the receiving queue manager's CLUSRCVR channel definition. Note that even if there are manually defined CLUSSDR channels, the attributes from the automatically defined CLUSSDR channel will be used. In addition, it is recommended to match the attributes of the manually defined cluster sender channel and cluster receiver channel completely.

$ runmqsc SampleQM
....
MQSC > alter qmgr repos(PLSRCLUS)
1 : alter qmgr repos(PLSRCLUS)
AMQ8005: IBM MQ queue manager changed.

MQSC > def chl('TO.SampleQM') chltype(clusrcvr) conname('localhost(1414)') cluster(PLSRCLUS)
2 : def chl('TO.SampleQM') chltype(clusrcvr) conname('localhost(1414)') cluster(PLSRCLUS)
AMQ8014: IBM MQ channel created.

<< Working with RemoteQM >>

Do the same with RemoteQM.

$ runmqsc RemoteQM
....
MQSC > alter qmgr repos(PLSRCLUS)
1 : alter qmgr repos(PLSRCLUS)
AMQ8005: IBM MQ queue manager changed.

MQSC > def chl('TO.SampleQM') chltype(clusrcvr) conname('localhost(1414)') cluster(PLSRCLUS)
2 : def chl('TO.SampleQM') chltype(clusrcvr) conname('localhost(1414)') cluster(PLSRCLUS)
AMQ8014: IBM MQ channel created.

<< Working with SampleQM >>

Create a manually defined cluster sender channel. Queue managers belonging to a cluster must always define manually defined cluster sender channel that connects to the full repository queue manager. If it is a full repository queue manager, define cluster sender channels that point to all other full repository queue managers.

MQSC > def chl('TO.RemoteQM') chltype(clussdr) conname('localhost(1415)') cluster(PLSRCLUS)
3 : def chl('TO.RemoteQM') chltype(clussdr) conname('localhost(1415)') cluster(PLSRCLUS)
AMQ8014: IBM MQ channel created.

<< Working with RemoteQM >>

Do the same with RemoteQM.

MQSC > def chl('TO.SampleQM') chltype(clussdr) conname('localhost(1414)') cluster(PLSRCLUS)
3 : def chl('TO.SampleQM') chltype(clussdr) conname('localhost(1414)') cluster(PLSRCLUS)
AMQ8014: IBM MQ channel created.

Create and start a new partial repository-queue manager, then define and start a listener. Define one manually defined cluster sender channel. Manually define the cluster sender channel to one of two full repositories, SampleQM or RemoteQM. Either is fine, but here we define the channel to SampleQM.

$ crtmqm PartialQM

*Please note that MQ8 for HP NonStop has a Guardian 8-character limit.
   The following is an example of MQ8.0 for HP NonStop
   $ crtmqm -ng sas13.PARTIAL PartialQM
   IBM MQ queue manager created.
   ....

$ strmqm PartialQM
IBM MQ queue manager 'PartialQM' starting.
IBM MQ queue manager 'PartialQM' started using V8.0.3.0.

$ runmqsc PartialQM
....
MQSC > def listener(listener) trptype(tcp) port(18553) control(qmgr)
1 : def listener(listener) trptype(tcp) port(18553) control(qmgr)
AMQ8626: IBM MQ listener created.

MQSC > sta listener(listener)
2 : sta listener(listener)
AMQ8021: Request to start IBM MQ listener accepted.
MQSC > dis lsstatus(listener) status
5 : dis lsstatus(listener) status
AMQ8631: Display listener status details.
LISTENER(LISTENER) STATUS(RUNNING)
....
MQSC > def chl('TO.SampleQM') chltype(clussdr) conname('localhost(1414)') cluster(PLSRCLUS)
3 : def chl('TO.SampleQM') chltype(clussdr) conname('localhost(1414)') cluster(PLSRCLUS)
AMQ8014: IBM MQ channel created.

Make sure that each queue manager lists three queue managers participating in the cluster.

MQSC > dis clusqmgr(*)
5 : dis clusqmgr(*)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(PartialQM) CHANNEL(TO.PartialQM)
CLUSTER(PLSRCLUS)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(RemoteQM) CHANNEL(TO.RemoteQM)
CLUSTER(PLSRCLUS)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(SampleQM) CHANNEL(TO.SampleQM)
CLUSTER(PLSRCLUS)

If it does not appear, check if the cluster sender and receiver channels between the three queue managers are started ("dis chs (*)"). Usually starts automatically. If the problem persists, check the error log and fix the problem. Please refer to the product manual for how to solve the problem.

<< Working with SampleQM and RemoteQM >>

Next, create cluster queues with the same name on SampleQM and RemoteQM.

MQSC > def ql(CQ1) cluster(PLSRCLUS)
6 : def ql(CQ1) cluster(PLSRCLUS)
AMQ8006: IBM MQ queue created.

*After defining both, you should be able to list the cluster queue defined by the following command from either queue manager.
MQSC > dis qc(*) CLUSQMGR
3 : dis qc(*) CLUSQMGR
AMQ8409: Display Queue details.
QUEUE(CQ1) TYPE(QCLUSTER)
CLUSQMGR(RemoteQM)
AMQ8409: Display Queue details.
QUEUE(CQ1) TYPE(QCLUSTER)
CLUSQMGR(SampleQM)

At this point, the cluster queue is not visible on PartialQM, the partial repository queue manager. The Partial Repository Queue Manager will now list the cluster queues after these have been used for the first time. This is also often misunderstood, but it is an MQ specification.


Ex. 5.5 Fix destination by group when writing to cluster queue

Create and write grouped messages to the cluster queue on PartialQM you just created, using a file similar to "Ex. 4.5 Generating grouped logical messages". At this time, add MQOO_BIND_ON_GROUP to the command line option, and repeat the same process 3 times with specifying "-n 3" and to write 3 groups. Even if "-n" is specified when writing a message, mqpgf's MQOPEN() is called only once.

Prepare a terminal or command prompt for SampleQM, RemoteQM and PartialQM respectively.

On SampleQM, wait for the message to arrive with the following command.
*If you use "-hex", the message and part of the header will be displayed in hexadecimal notation. In MQMD fields, Report and Msgflags are displayed in hexadecimal notation. (See mqpgf User's Guide for more information.)

$ mqpgf -qm SampleQM -q CQ1 -dpv -hex -r MQGMO_WAIT MQWI_UNLIMITED MQGMO_NO_SYNCPOINT

*Option descriptions
-hex: Display the data and part of the header in hexadecimal format.
-r: Repeat the process(for receiveing).
MQGMO_WAIT: Set MQGMO_WAIT of MQGMO.Options
MQWI_UNLIMITED: Set MQGMO.WaitInterval to MQWI_UNLIMITED

Wait for the message to arrive on RemoteQM with the same command.

$ mqpgf -qm RemoteQM -q CQ1 -dpv -hex -r MQGMO_WAIT MQWI_UNLIMITED MQGMO_NO_SYNCPOINT

On PartialQM, create three groups with the command described earlier and write them to the cluster queue (CQ1).

$ mqpgf -qm PartialQM -q CQ1 -f largemsg2.txt -dl 0x0a MQMD_VERSION_2 MQPMO_LOGICAL_ORDER MQOO_BIND_ON_GROUP -n 3
[18/06/19 15:23:30] 1: put from: largemsg2.txt
[18/06/19 15:23:30] 1: logical message: 1 length: 10 put message: 1234567890
[18/06/19 15:23:30] 1: logical message: 2 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 1: logical message: 3 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 1: logical message: 4 length: 36 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
[18/06/19 15:23:30] 1: logical message: 5 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 2: put from: largemsg2.txt
[18/06/19 15:23:30] 2: logical message: 1 length: 10 put message: 1234567890
[18/06/19 15:23:30] 2: logical message: 2 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 2: logical message: 3 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 2: logical message: 4 length: 36 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
[18/06/19 15:23:30] 2: logical message: 5 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 3: put from: largemsg2.txt
[18/06/19 15:23:30] 3: logical message: 1 length: 10 put message: 1234567890
[18/06/19 15:23:30] 3: logical message: 2 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 3: logical message: 3 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz
[18/06/19 15:23:30] 3: logical message: 4 length: 36 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
[18/06/19 15:23:30] 3: logical message: 5 length: 62 put message: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqxyz

Three sets of grouped messages are created.
Messages should be written to both SampleQM and RemoteQM's cluster queue, retrieved, and displayed as follows: (SampleQM and RemoteQM may be reversed as it is the result of workload balancing.)


Test result 5.5.1

*Dumping of messages arriving on SampleQM's cluster queue
message number: 1
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002868] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002869] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]
data length: 10
00000000: 3132 3334 3536 3738 3930 '1234567890 '

message number: 2
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D82000286B] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002869] MsgSeqNumber[2] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 3
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D82000286D] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002869] MsgSeqNumber[3] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 4
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D82000286F] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002869] MsgSeqNumber[4] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 36
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 'WXYZ '

message number: 5
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002871] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002869] MsgSeqNumber[5] Offset[0] MsgFlags[0x00000018] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 6
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D82000287E] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D82000287F] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 10
00000000: 3132 3334 3536 3738 3930 '1234567890 '

message number: 7
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002881] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D82000287F] MsgSeqNumber[2] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 8
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002883] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D82000287F] MsgSeqNumber[3] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 9
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002885] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D82000287F] MsgSeqNumber[4] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 36
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 'WXYZ '

message number: 10
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002887] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D82000287F] MsgSeqNumber[5] Offset[0] MsgFlags[0x00000018] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '


Test result 5.5.2

*Dumping of messages arriving on RemoteQM's cluster queue
message number: 1
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002873] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002874] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 10
00000000: 3132 3334 3536 3738 3930 '1234567890 '

message number: 2
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002876] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002874] MsgSeqNumber[2] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 3
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D820002878] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002874] MsgSeqNumber[3] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

message number: 4
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D82000287A] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002874] MsgSeqNumber[4] Offset[0] MsgFlags[0x00000008] OriginalLength[-1]

data length: 36
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 'WXYZ '

message number: 5
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2897D82000287C] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180619] PutTime[06233067] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2897D820002874] MsgSeqNumber[5] Offset[0] MsgFlags[0x00000018] OriginalLength[-1]

data length: 62
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'
00000020: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000030: 6D6E 6F70 7172 7374 7576 7178 797A 'mnopqrstuvqxyz '

It can be confirmed that messages with the following three types of group IDs are allocated to the SapmleQM and RemoteQM in that unit.

SampleQM:
GroupId[0x414D51205061727469616C514D2020205B2897D820002869]

RemoteQM:
GroupId[0x414D51205061727469616C514D2020205B2897D82000287F]
GroupId[0x414D51205061727469616C514D2020205B2897D820002874]

Note that all three groups of messages are written with one MQOPEN() to the cluster queue (CQ1). It does not mean that MQOPEN() is called for each queue manager. Check the difference in behavior when MQOO_BIND_ON_OPEN and MQOO_BIND_NOT_FIXED are specified.

fig 5.7


Cluster queues and segmentation

When segmenting with the MAXMSGL setting of a cluster queue, it is not the sending queue manager but the receiving queue manager that segments the message. Note that segmented messages are not sent or received. Change MAXMSGL to the value you want to segment on each queue manager that hosts cluster queues.


Ex. 5.6 Segmentation on cluster queues

I will actually test it and check it.

Set MAXMSGL to 40 for both SampleQM and RemoteQM cluster queues.

$ echo "alter ql(CQ1) maxmsgl(40)" | runmqsc SampleQM
$ echo "alter ql(CQ1) maxmsgl(40)" | runmqsc RemoteQM
*Windows does not require semicolons.

Check MQXMSGL and CURDEPTH in advance.

$ mqpcf que -qm SampleQM -q CQ1 MAXMSGL CURDEPTH -t
[18/06/22 09:52:53] 1: QUEUE(CQ1) TYPE(QLOCAL) CURDEPTH(0) MAXMSGL(40)

$ mqpcf que -qm RemoteQM -q CQ1 MAXMSGL CURDEPTH -t
[18/06/22 09:52:59] 1: QUEUE(CQ1) TYPE(QLOCAL) CURDEPTH(0) MAXMSGL(40)

Cluster channels are also started automatically when sending a message, but have been started to check the channel status in advance.

$ mqpcf sta -qm PartialQM -c TO.SampleQM
MQExecute : Command Server Error. mqExecuteCC=[2], mqExecuteRC=[3008], mqCommandCC=[2], mqCommandRC=[4031]
MQExecute : Command Server Error. mqExecuteCC=[2], mqExecuteRC=[3008], mqCommandCC=[2], mqCommandRC=[3008]
$ mqrc 4031

4031 0x00000fbf MQRCCF_CHANNEL_IN_USE

*If the channel has already been started, it will fail with the above reason code.

$ mqpcf sta -qm PartialQM -c TO.RemoteQM
Channel Start Success. Channel Name : TO.RemoteQM

Check the two sender channels on the Partial QM side, CURSEQNO and MSGS in TO.SampleQM and TO.RemoteQM.

$ mqpcf chs -qm PartialQM -c TO.* CURSEQNO MSGS -t
[18/06/22 10:01:09] 1: CHLINSTYPE(CURRENT) CHANNEL(TO.SampleQM) STATUS(RUNNING) CHLTYPE(CLUSSDR) CONNAME(10.41.207.3(1414)) RQMNAME(SampleQM) STOPREQ(NO) SUBSTATE(MQGET) XMITQ(SYSTEM.CLUSTER.TRANSMIT.QUEUE) CURSEQNO(9) MSGS(1)
[18/06/22 10:01:09] 2: CHLINSTYPE(CURRENT) CHANNEL(TO.RemoteQM) STATUS(RUNNING) CHLTYPE(CLUSSDR) CONNAME(10.41.207.3(1415)) RQMNAME(RemoteQM) STOPREQ(NO) SUBSTATE(MQGET) XMITQ(SYSTEM.CLUSTER.TRANSMIT.QUEUE) CURSEQNO(8) MSGS(0)
....

*The meaning of MSGS and CURSEQNO is as follows.

MSGS: Number of messages sent or received since the channel started
CURSEQNO: Sequence number of the last message sent or received


Write a message from PartialQM with MQMF_SEGMENTATION_ALLOWED.

$ mqpgf -qm PartialQM -q CQ1 -f largemsg.txt MQMF_SEGMENTATION_ALLOWED MQMD_VERSION_2
[18/06/22 10:01:56] 1: put from: largemsg.txt

Check CURDEPTH on the queue manager hosting CQ1.


Test result 5.6.1

$ mqpcf que -qm SampleQM -q CQ1 CURDEPTH -t
[18/06/22 10:02:08] 1: QUEUE(CQ1) TYPE(QLOCAL) CURDEPTH(0)
$ mqpcf que -qm RemoteQM -q CQ1 CURDEPTH -t
[18/06/22 10:02:15] 1: QUEUE(CQ1) TYPE(QLOCAL) CURDEPTH(10)

*The RemoteQM side has been changed to 10 cases.

Check how CURSEQNO and MSGS changed.


Test result 5.6.2

$ mqpcf chs -qm PartialQM -c TO.* CURSEQNO MSGS -t
[18/06/22 10:02:33] 1: CHLINSTYPE(CURRENT) CHANNEL(TO.SampleQM) STATUS(RUNNING) CHLTYPE(CLUSSDR) CONNAME(xxx.xxx.xxx.xxx(xxxx)) RQMNAME(SampleQM) STOPREQ(NO) SUBSTATE(MQGET) XMITQ(SYSTEM.CLUSTER.TRANSMIT.QUEUE) CURSEQNO(9) MSGS(1)
[18/06/22 10:02:33] 2: CHLINSTYPE(CURRENT) CHANNEL(TO.RemoteQM) STATUS(RUNNING) CHLTYPE(CLUSSDR) CONNAME(xxx.xxx.xxx.xxx(xxxx)) RQMNAME(RemoteQM) STOPREQ(NO) SUBSTATE(MQGET) XMITQ(SYSTEM.CLUSTER.TRANSMIT.QUEUE) CURSEQNO(9) MSGS(1)
....

*TO.Remote QM is incremented by 1 each to CURSEQNO: 8->9, MSGS: 0->1. This indicates that only one message has been transmitted. And CURDEPTH is 10 shows that it was segmented by the receiving side queue manager when MCA(message channel agent) of the receiving channel written to the receiving queue(CQ1).

Dump and confirm the RemoteQM cluster queue.


Test result 5.6.3

$ mqpgf -qm RemoteQM -q CQ1 -dpv -r -hex
message number: 1
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B2C448020002A0B] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
00000010: 4748 494A 4B4C 4D4E 4F50 5152 5354 5556 'GHIJKLMNOPQRSTUV'

message number: 2
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002902] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[32] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 5758 595A 6162 6364 6566 6768 696A 6B6C 'WXYZabcdefghijkl'
00000010: 6D6E 6F70 7172 7374 7576 7178 797A 0A31 'mnopqrstuvqxyz.1'

message number: 3
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002903] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[64] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 3233 3435 3637 3839 3041 4243 4445 4647 '234567890ABCDEFG'
00000010: 4849 4A4B 4C4D 4E4F 5051 5253 5455 5657 'HIJKLMNOPQRSTUVW'

message number: 4
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002904] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[96] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 5859 5A61 6263 6465 6667 6869 6A6B 6C6D 'XYZabcdefghijklm'
00000010: 6E6F 7071 7273 7475 7671 7879 7A0A 3132 'nopqrstuvqxyz.12'

message number: 5
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002905] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[128] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 3334 3536 3738 3930 4142 4344 4546 4748 '34567890ABCDEFGH'
00000010: 494A 4B4C 4D4E 4F50 5152 5354 5556 5758 'IJKLMNOPQRSTUVWX'

message number: 6
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002906] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[160] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 595A 6162 6364 6566 6768 696A 6B6C 6D6E 'YZabcdefghijklmn'
00000010: 6F70 7172 7374 7576 7178 797A 0A31 3233 'opqrstuvqxyz.123'

message number: 7
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002907] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[192] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 3435 3637 3839 3041 4243 4445 4647 4849 '4567890ABCDEFGHI'
00000010: 4A4B 4C4D 4E4F 5051 5253 5455 5657 5859 'JKLMNOPQRSTUVWXY'

message number: 8
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002908] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[224] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 5A61 6263 6465 6667 6869 6A6B 6C6D 6E6F 'Zabcdefghijklmno'
00000010: 7071 7273 7475 7671 7879 7A0A 3132 3334 'pqrstuvqxyz.1234'

message number: 9
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C20002909] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[256] MsgFlags[0x00000003] OriginalLength[32]

data length: 32
00000000: 3536 3738 3930 4142 4344 4546 4748 494A '567890ABCDEFGHIJ'
00000010: 4B4C 4D4E 4F50 5152 5354 5556 5758 595A 'KLMNOPQRSTUVWXYZ'

message number: 10
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D512052656D6F7465514D202020205B2C445C2000290A] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180622] PutTime[01015632] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B2C448020002A0C] MsgSeqNumber[1] Offset[288] MsgFlags[0x00000007] OriginalLength[27]

data length: 27
00000000: 6162 6364 6566 6768 696A 6B6C 6D6E 6F70 'abcdefghijklmnop'
00000010: 7172 7374 7576 7178 797A 0A 'qrstuvqxyz. '

no message available : CQ1 CompCd=02 ReasonCd=2033

The method to confirm that it is segmented has already been explained, so I will omit it.

After testing, restore the MAXMSGL value.

$ echo "alter ql(CQ1) maxmsgl(4194304)" | runmqsc SampleQM
$ echo "alter ql(CQ1) maxmsgl(4194304)" | runmqsc RemoteQM

fig 5.8


Segmentation on the sender side queue manager

If you want to segment on the sending side for some reason and also want to fix the destination, you can use the queue manager MAXMSGL to perform segmentation. In this case, the functionality of MQOO_BIND_ON_GROUP is enabled, whether it is segmenting a single message or in combination with grouped messages.


Ex. 5.7 Segmentation and destination fixing on the sender queue manager

Try to have the queue manager segment a single message that does not belong to a group. Set MAXMSGL of queue manager property to 32768 which is the minimum value that can be set.

$ mqpcf qmgr -qm PartialQM MAXMSGL
1: QMNAME(PartialQM) MAXMSGL(32768)

Fix the length to 50000 and write the same file to the cluster queue three times. MQOPEN() is called once.

$ mqpgf -qm PartialQM -q CQ1 -f largemsg.txt -l 50000 MQMF_SEGMENTATION_ALLOWED MQMD_VERSION_2 MQOO_BIND_ON_GROUP -n 3
[18/06/20 11:30:09] 1: put from: largemsg.txt
[18/06/20 11:30:09] 2: put from: largemsg.txt
[18/06/20 11:30:09] 3: put from: largemsg.txt

*Option descriptions
-l: Forces the data length to the specified size.
MQMF_SEGMENTATION_ALLOWED: Set MQMF_SEGMENTATION_ALLOWED of MQMD.MsgFlags
MQMD_VERSION_2: Set MQMD.Version to MQMD_VERSION_2
MQOO_BIND_ON_GROUP: Set MQOO_BIND_ON_GROUP of MQOPEN Options
-n: Repeat the process three times.

Check the messages arriving on the SampleQM and RemoteQM cluster queues.
First, try dumping SampleQM's CQ1.


Test result 5.7.1

$ mqpgf -qm SampleQM -q CQ1 -dpv -r -hex MQGMO_ACCEPT_TRUNCATED_MSG
MQGET with warning : CQ1 CompCd=01 ReasonCd=2079 len=32256
message number: 1
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B299F5020002D02] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180620] PutTime[02300923] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B299F5020002D03] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000003] OriginalLength[32256]

data length: 32256
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
....
MQGET with warning : CQ1 CompCd=01 ReasonCd=2079 len=17744
message number: 2
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B299F5020002D05] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180620] PutTime[02300923] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B299F5020002D03] MsgSeqNumber[1] Offset[32256] MsgFlags[0x00000007] OriginalLength[17744]

data length: 17744
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 '................'
....

MQGET with warning : CQ1 CompCd=01 ReasonCd=2079 len=32256
message number: 3
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B299F5020002D0C] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180620] PutTime[02300924] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B299F5020002D0D] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000003] OriginalLength[32256]

data length: 32256
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
....

MQGET with warning : CQ1 CompCd=01 ReasonCd=2079 len=17744
message number: 4
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B299F5020002D0F] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180620] PutTime[02300924] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B299F5020002D0D] MsgSeqNumber[1] Offset[32256] MsgFlags[0x00000007] OriginalLength[17744]

data length: 17744
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 '................'
....
no message available : CQ1 CompCd=02 ReasonCd=2033

Next, dump RemoteQM's CQ1.


Test result 5.7.2

$ mqpgf -qm RemoteQM -q CQ1 -dpv -r -hex MQGMO_ACCEPT_TRUNCATED_MSG
MQGET with warning : CQ1 CompCd=01 ReasonCd=2079 len=32256
message number: 1
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B299F5020002D07] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180620] PutTime[02300924] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B299F5020002D08] MsgSeqNumber[1] Offset[0] MsgFlags[0x00000003] OriginalLength[32256]

data length: 32256
00000000: 3132 3334 3536 3738 3930 4142 4344 4546 '1234567890ABCDEF'
....

MQGET with warning : CQ1 CompCd=01 ReasonCd=2079 len=17744
message number: 2
*StrucId[MD ] Version[2] Report[0x00000000] MsgType[8] Expiry[-1] Feedback[0] Encoding[273] CodedCharSetId[819] Format[ ] Priority[0] Persistence[0] MsgId[0x414D51205061727469616C514D2020205B299F5020002D0A] CorrelId[0x000000000000000000000000000000000000000000000000] BackoutCount[0] ReplyToQ[ ] ReplyToQMgr[PartialQM ] UserIdentifier[mqm ] AccountingToken[0x0534343033310000000000000000000000000000000000000000000000000006] ApplIdentityData[ ] PutApplType[13] PutApplName[mqpgf ] PutDate[20180620] PutTime[02300924] ApplOriginData[ ]

GroupId[0x414D51205061727469616C514D2020205B299F5020002D08] MsgSeqNumber[1] Offset[32256] MsgFlags[0x00000007] OriginalLength[17744]

data length: 17744
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 '................'
....

no message available : CQ1 CompCd=02 ReasonCd=2033

A unique GroupId is also assigned when segmenting a single message and it can be confirmed that workload balancing is performed for each GroupId.

fig 5.9

*MQOO_BIND_ON_GROUP is not enabled when segmentation is performed in the application under validation with "IBM MQ 8.0.3.0 for HP NonStop" or "IBM MQ 9.0.3.0 for Windows". The same is true for applications that segment on logical messages that are part of a group. Also, MQOO_BIND_ON_GROUP has no effect when relaying grouped or segmented messages.

Finally, here is a summary of the timing at which the workload management algorithm is executed.

MQOO_BIND_ON_OPEN: When the cluster queue is opened
MQOO_BIND_NOT_FIXED: When a message is written to a cluster queue
MQOO_BIND_ON_GROUP: When a new message group is started

This concludes the discussion of MQMD. From next time, we will continue serialization on a new theme.

to the top

to the top