A message collection can be constructed by using Java™ and the MbMessageCollection class. Using a message collection is useful if messages must be grouped together for parsing, or if the message collection must be constructed to represent a particular data structure, such as a CICS® Transaction Server for z/OS® channel data structure.
A message collection is a message that consists of a Properties header and a single domain element named Collection. The Collection folder contains a number of child messages, each of which can contain a Properties folder, a number of headers (such as MQMD), and a body. A message collection can also have zero or more attributes that are name/value pairs. The name of an attribute must be unique within a message collection. A standard attribute for the message collection is an attribute called CollectionName.
The following figure shows an example of a message collection structure.
You can create a message collection by using Java, and the MbMessageCollection class, to group messages together for parsing, or create a message collection that must be constructed to represent a particular data structure, such as a CICS channel data structure.
To configure a message collection by using Java, complete the following steps:
TraceOutput: Root ( ['MQROOT' : 0xee3a90]
(0x01000000:Name):Properties = ( ['MQPROPERTYPARSER' : 0xae4370]
(0x03000000:NameValue):myProperty1 = 'propertyData1' (CHARACTER)
(0x03000000:NameValue):myProperty2 = 'propertyData2' (CHARACTER)
)
(0x01000000:Name):Collection = ( ['COLLECTION' : 0x58d0b08]
(0x03000000:NameValue):CollectionName = 'myCollectionName' (CHARACTER)
(0x03000000:NameValue):NAME1 = 'Value1' (CHARACTER)
(0x03000000:NameValue):NAME2 = 12345 (INTEGER)
(0x01000000:Name ):Folder1 = ( ['COLLECTIONFOLDER' : 0xee42e8]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0xae39e8]
(0x03000000:NameValue):myFolder1Property1 = 'folder1propertyData1' (CHARACTER)
(0x03000000:NameValue):myFolder1Property2 = 'folder1propertyData2' (CHARACTER)
)
(0x01000021:Name+):MRM = ( ['mrm' : 0xdce588]
(0x01000000:Name):msg = (
(0x03000000:NameValue):data = 'myData' (CHARACTER)
)
)
)
(0x01000000:Name ):Folder2 = ( ['COLLECTIONFOLDER' : 0xee3d58]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0xae4cf8]
(0x03000000:NameValue):myFolder2Property1 = 'folder2propertyData1' (CHARACTER)
(0x03000000:NameValue):myFolder2Property2 = 'folder2propertyData2' (CHARACTER)
)
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0xee2188]
(0x01000000:Folder):msg2 = (
(0x03000000:PCDataField):myData2 = 'myXMLData' (CHARACTER)
)
)
)
)
)