Field details for MQRFH2
The MQRFH2 Rules and formatting header 2 header is based on the
MQRFH header, but it allows Unicode strings to be transported without translation,
and it can carry numeric data types.
StrucId (MQCHAR4)
This is the structure identifier of the rules and formatting header two structure. It is always an input field. Its value is MQRFH2_STRUC_ID.
- MQRFH2_STRUC_ID
- Identifier for the rules and formatting header two structure.
For the C programming language, the constant MQRFH2_STRUC_ID_ARRAY is also defined. This has the same value as MQRFH2_STRUC_ID, but is an array of characters instead of a string.
Version (MQLONG)
- MQRFH_VERSION_2
- Version-2 rules and formatting header structure.
The initial value of this field is MQRFH_VERSION_2.
StrucLength (MQLONG)
NameValueLength and
NameValueData fields at the end of the structure. It is valid
for there to be multiple pairs of NameValueLength and
NameValueData fields at the end of the structure, in the
sequence: length1, data1, length2, data2, ...
StrucLength does not include any user data that might follow
the last NameValueData field at the end of the structure.
To avoid problems with converting the user data in some environments,
StrucLength must be a multiple of four.
NameValueLength and
NameValueData fields:- MQRFH_STRUC_LENGTH_FIXED_2
- Length of fixed part of MQRFH2 structure.
The initial value of this field is MQRFH_STRUC_LENGTH_FIXED_2.
Encoding (MQLONG)
This specifies the numeric encoding of the data that follows the last
NameValueData field; it does not apply to numeric data in the
MQRFH2 structure itself.
On the MQPUT or MQPUT1 call, the application must set this field to the value appropriate to the data.
The initial value of this field is MQENC_NATIVE.
CodedCharSetId (MQLONG)
This specifies the character set identifier of the data that follows the last
NameValueData field; it does not apply to character data in the
MQRFH2 structure itself.
- MQCCSI_INHERIT
- Character data in the data following this structure is in the same character set as this
structure.
The queue manager changes this value in the structure sent in the message to the actual character-set identifier of the structure. Provided no error occurs, the value MQCCSI_INHERIT is not returned by the MQGET call.
MQCCSI_INHERIT cannot be used if the value of the
PutApplTypefield in MQMD is MQAT_BROKER.
The initial value of this field is MQCCSI_INHERIT.
Format (MQCHAR8)
This specifies the format name of the data that follows the last
NameValueData field.
On the MQPUT or MQPUT1 call, the application must set this field to the value appropriate to the
data. The rules for coding this field are the same as those for the
Format field in MQMD.
The initial value of this field is MQFMT_NONE.
Flags (MQLONG)
The initial value of this field is MQRFH_NONE. MQRFH_NONE must
be specified.
MQRFH_NONE- No flags.
MQRFH_INTERNAL- The
MQRFH2header contains internally set properties.MQRFH_INTERNALis for queue manager use.
The top 16 bits, MQRFH_FLAGS_RESTRICTED_MASK, are reserved for flags the queue
manager sets. Flags that a user might set are defined in the bottom 16 bits.
NameValueCCSID (MQLONG)
This specifies the coded character set identifier of the data in the
NameValueData field. This is different from the character set of
the other strings in the MQRFH2 structure, and can be different from the character set of the data
(if any) that follows the last NameValueData field at the end of
the structure.
NameValueCCSID must have one of the following values:
| CCSID | Meaning |
|---|---|
| 1200 | UTF-16, most recent Unicode version supported |
| 13488 | UTF-16, Unicode version 2.0 subset |
| 17584 | UTF-16, Unicode version 3.0 subset (includes the Euro symbol) |
| 1208 | UTF-8, most recent Unicode version supported |
For the UTF-16 character sets, the encoding (byte order) of the
NameValueData must be the same as the encoding of the other
fields in the MQRFH2 structure.
Characters beyond the Unicode Basic Multilingual Plane (those above U+FFFF), represented in UTF-16 by surrogate code points (X'D800' through X'DFFF'), or four bytes in UTF-8, are not supported.
NameValueCCSID does not have one of the values listed
above, and the MQRFH2 structure requires conversion on the MQGET call, the call completes with
reason code MQRC_SOURCE_CCSID_ERROR and the message is returned unconverted. The initial value of this field is 1208.
NameValueLength (MQLONG)
The length of the corresponding NameValueData field.
This specifies the length in bytes of the data in the
NameValueData field.
NameValueLength must be a multiple of four.
NameValueLength and
NameValueData fields are optional, but if present they must
occur as a pair and be adjacent. The pair of fields can be repeated as many times as required, for
example: length1 data1 length2 data2 length3 data3
Because these fields are optional, they are omitted from the declarations of the structure that are provided for the various programming languages supported.
NameValueData (MQCHARn)
NameValueData is a variable length field that contains a folder
containing name-value pairs of message properties.
A folder is a variable-length character string containing data encoded using an XML-like syntax.
The length in bytes of the character string is given by the
NameValueLength field that precedes the
NameValueData field. The length must be a multiple of four.
NameValueLength and
NameValueData fields are optional, but if present they must
occur as a pair and be adjacent. The pair of fields can be repeated as many times as required, for
example: length1 data1 length2 data2 length3 data3
NameValueData is not converted to the character set specified
on the MQGET call. Even if the message is retrieved with the
MQGMO_CONVERT option in effect NameValueData
remains in its original character set. However, NameValueData is
converted to the encoding specified on the MQGET call.
- Because these fields are optional, they are omitted from the declarations of the structure that are provided for the various programming languages supported.
- The terms
defined
andreserved
are used in the syntax diagram.Defined
means that the name is used by IBM® MQ.Reserved
means that the name is reserved for future use by IBM MQ.
NameValueData syntax
- 1 Double quotation marks or single quotation marks are valid.
- 2 Do not use an invalid property name; see Invalid property name. Use a reserved property name only for its defined purpose; see Defined property names.
- 3 The name must be in lowercase.
- 4 Only one psc and pscr folder is supported.
- 5 WebSphere® Application Server Service Integration Bus ignores
sib, sib_context, and sib_usr folders in
subsequent
MQRFH2headers, and only properties in the firstMQRFH2header are significant. - 6 Not more than one usr folder must be present in an
MQRFH2. Properties in the usr folder must occur no more than once. - 7 Only properties in the first mq folder are significant. If the
folder is
UTF-8, only single byteUTF-8characters are supported. The only white space character is UnicodeU+0020. - 8
Valid characters are defined in the W3C XML specification, and consist essentially of
Unicode categories
Ll, Lu, Lo, Lt, Nl, Mc, Mn, Lm,andNd; see Unicode character categories. - 9 All characters are significant. Leading and trailing blanks are part of the element value.
- 10 Do not use an invalid character; see Invalid characters. Use an escape sequence, rather than these invalid characters.
- 11 The support property attribute is only valid on the mq folder
Folder name
NameValueData contains a single folder. To create multiple
folders, create multiple NameValueData fields. You can create
multiple NameValueData fields in a single
MQRFH2 header within a message. Alternatively you can create multiple chained
MQRFH2 headers, each containing multiple
NameValueData fields.
The order of MQRFH2 headers, and the order of
NameValueData fields makes no difference to the logical contents
of a folder. If the same folder is present more than once in a message the folder is parsed as a
whole. If the same property occurs in muliple instances of the same folder, it is parsed as a list.
A correct parse of an MQRFH2 is not affected by the alternative ways a folder
can be physically stored in a message.
Four folders do not follow this rule. Only the first instance of the mq,
sib, sib_context, and sib_usr folder are parsed.
If the same property occurs more than once in the combined contents of the chained
MQRFH2 headers, only the first instance of the property is parsed. If a property is
set using an API call, such as MQSETMP, and added to an MQRFH2
directly by an application, the API call takes precedence.
A folder name is the name of a folder containing name-value pairs or groups. Groups and name-value pairs can be mixed at the same level in the folder tree; see Figure 1. Do not combine a group name and an element name; see Figure 2
<group1><nvp1>value</nvp1></group1><group2><nvp2>value</nvp2></group2>
<group3><nvp1>value</nvp1></group3><nvp3>value</nvp3>
<group1><nvp1> value </nvp1> value </group1>
Do not use an invalid or reserved folder name; see Invalid path name and Reserved folder or property folder name. Use a defined folder name only for its defined purpose; see Defined folder name.
If you add the attribute content='properties' to the folder name tag, the folder
becomes a property folder; see Figure 3.
<myFolder></myfolder>
<myPropertyFolder content='properties'></myPropertyFolder>
Folder names are case-sensitive. Folder names and property folder names share the same namespace.
They must have different names. Folder1 in Figure 4
must be a different name to Folder2 in Figure 5.
Folder1 namespace< Folder1 ><NVP1> value </NVP1></ Folder1 >
Folder2 namespace< Folder2 content='properties'>< Property1 > value </ Property1 ></ Folder2 >
Groups, properties, and name-value pairs in different folders have different namespaces. Property1 in Figure 5 is a different property to Property1 in Figure 6.
Folder3 namespace<Folder3 content='properties'>< Property1 > value </ Property1 ></Folder3>
Property folders are different to non-property folders in two important respects:
- Property folders contain properties, and non-property folders contain name-value pairs. The folders differ slightly, syntactically.
- Use the defined interfaces, such as the properties MQI, or JMS message properties, to access message properties. The
interfaces ensure the property folders in the
MQRFH2are well-formed. A well-formed property folder is interoperable between queue managers on different platforms and different releases.
The message property MQI is a robust way to read and write an MQRFH2, and avoids
the difficulties of parsing an MQRFH2 correctly.
Defined folder name
A defined folder name is the name of a folder that is reserved for use by IBM MQ, or another product. Do not create a folder of the same name, and do not add your own name-value pairs to the folders. The defined folders are psc and pscr.
psc and pscr are used by queued publish/subscribe.
A segmented message put with either MQMF_SEGMENT or
MQMF_SEGMENTATION_ALLOWED cannot contain an MQRFH2 with a defined
folder name. The MQPUT fails with reason code 2443,
MQRC_SEGMENTATION_NOT_ALLOWED.
Defined property folder name
A defined property folder name is the name of a property folder that is used by IBM MQ, or another product. For the names of the folders and their contents, see Property folders. Defined property folder names are a subset of all the folder names reserved by IBM MQ; see Reserved folder or property folder name.
Any element stored in a defined property folder is a property. An element stored in a defined
property folder must not have a content='properties' attribute.
You can add properties only to the defined property folders usr, mq_usr, and sib_usr. In other property folders, such as mq and sib, IBM MQ ignores or throws away properties it does not recognize.
The description of each defined property folder lists the properties that IBM MQ has defined that can be used by application programs. Some of the properties are accessed indirectly by setting or getting a JMS property, and some are accessed directly using the MQSETMP and MQINQMP MQI calls.
The defined property folders also contain other properties that IBM MQ has reserved, but which applications do not have access to. The names of the reserved properties are not listed. No reserved properties are present in the usr, mq_usr, and sib_usr property folders. But do not create properties with invalid property names; see Invalid property name.
Property folders
jms-
jmscontains JMS header fields, and JMSX properties that cannot be fully expressed in theMQMD. Thejmsfolder is always present in a JMSMQRFH2.Table 1. jms property name, synonym, data type, and folder Property synonym Property name Data type Folder JMSDestination jms.Dst string<jms><Dst> destination </Dst></jms>JMSExpiration jms.Exp i8<jms><Exp> expiration </Exp></jms>JMSCorrelation jms.Cid string<jms><Cid> correlationId </Cid></jms>JMSDelivery jms.Dlv i4<jms><Dlv> delivery </Dlv></jms>JMSPriority jms.Pri i4<jms><Pri> priority </Pri></jms>JMSReplyTo jms.Rto string<jms><Rto> replyToURI </Rto></jms>JMSTimeStamp jms.Tms i8<jms><Tms> timestamp </Tms></jms>JMSXGroupID jms.Gid string<jms><Gid> groupId </Gid></jms>JMSXGroupSeq jms.Seq i4<jms><Seq> messageSequenceNo </Seq></jms>Do not add your own properties in the
jmsfolder. mcd-
mcdcontains properties that describe the format of the message. For example, the message service domain Msd property identifies a JMS message as being JMSTextMessage, JMSBytesMessage, JMSStreamMessage, JMSMapMessage, JMSObjectMessage, or null.The
mcdfolder is always present in a JMS message containing anMQRFH2.It is always present in a message containing an
MQRFH2sent from IBM Integration Bus. It describes the domain, format, type, and message set of a message.Table 2. mcdproperty name, synonym, data type, and folderProperty synonym Property name Data type Folder mcd.Msd string<mcd><Msd>messageDomain</Msd></mcd>mcd.Set string<mcd><Set>messageDomain</Set></mcd>mcd.Type string<mcd><Type>messageDomain</Type></mcd>mcd.Fmt string<mcd><Fmt>messageDomain</Fmt></mcd>Do not add your own properties in the
mcdfolder. mq_usr-
mq_usrcontains application-defined properties that are not exposed as JMS user-defined properties. Properties that do not meet JMS requirements can be placed in this folder.You can create properties in the
mq_usrfolder. Properties you create in themq_usrare like properties you create in new folders with thecontent='properties'attribute. sib-
sibcontains WebSphere Application Server service integration bus (WAS/SIB) system message properties.sibproperties are not exposed as JMS properties to IBM MQ JMS applications because they are not of the supported types. For example, somesibproperties cannot be exposed as JMS properties because they are byte arrays. Somesibproperties are exposed to WAS/SIB applications asJMS_IBM_*properties; these include forward and reverse routing paths properties.Do not add your own properties in the
sibfolder. sib_context-
sib_contextcontains WAS/SIB system message properties that are not exposed to WAS/SIB user applications or as JMS properties.sib_contextcontains security and transactional properties that are used for web services.Do not add your own properties in the
sib_contextfolder. sib_usr-
sib_usrcontains WAS/SIB user message properties that are not exposed as JMS user properties because they are not of supported types.sib_usris exposed to WAS/SIB applications in the SIMessage interface; see Developing Service Integration.The type of a
sib_usrproperty must bebin.hex, and the value must be in the correct format. If an IBM MQ application writes abin.hextyped element to the folder in the wrong format, the application receives an IOException. If the data type of the property is notbin.hexthe application receives a ClassCastException.Do not attempt to make JMS user properties available to WAS/SIB by using this folder; instead use the
usrfolder.You can create properties in the
sib_usrfolder. usr-
usrcontains application-defined JMS properties associated with the message. Theusrfolder is present only if an application has set an application-defined property.usris the default property folder. If a property is set without a folder name, it is placed in theusrfolder.Table 3. usr property name, synonym, data type, and folder Property synonym Property name Data type Folder usr.contentType string<usr><contentType>text/xml; charset=utf-8</contentType></usr>usr.endPointURL string<usr><endPointURL> URI </endPointURL></usr>usr.targetService string<usr><targetService> serviceName </targetService></usr>usr.soapAction string<usr><soapAction> name </soapAction></usr>usr.transportVersion string<usr><transportVersion> version </transportVersion></usr>You can create properties in the
usrfolder.
A segmented message put with either MQMF_SEGMENT or
MQMF_SEGMENTATION_ALLOWED cannot contain an MQRFH2 with a defined
property folder name. The MQPUT fails with reason code 2443,
MQRC_SEGMENTATION_NOT_ALLOWED.
Ungrouped property folder name
ibm-
ibmcontains properties that are used only by IBM MQ.Table 4. ibmproperty name, synonym, data type, and folderProperty synonym Property name Data type Folder ibm.rfp string<ibm><rfp>fingerprint</rfp></ibm>Do not add your own properties in the
ibmfolder. mq-
mqcontains properties that are used only by IBM MQ.The following restrictions apply to properties in the
mqfolder:- Only properties in the first significant
mqfolder in the message are acted upon by MQ; properties in any othermqfolder in the message are ignored. - Only single-byte UTF-8 characters are allowed in the folder. A multi-byte character in the folder, can cause parsing to fail, and the message to be rejected.
- Do not use escape strings in the folder. An escape string is treated as the actual value of the element.
- Only Unicode character
U+0020is treated as white space within the folder. All other characters are treated as significant and can cause parsing of the folder to fail, and the message to be rejected.
If parsing of the
mqfolder fails, or if the folder does not observe these restrictions, the message is rejected with reason code2527,MQRC_RFH_RESTRICTED_FORMAT_ERR.Do not add your own properties in the
mqfolder. - Only properties in the first significant
mqema-
mqemacontains properties that are used only by WebSphere Application Server. The folder has been replaced bymqext.Do not add your own properties in the
mqemafolder. mqext-
mqextcontains the following types of property:- Properties that are used only by WebSphere Application Server.
- Properties relating to delayed delivery of messages.
Table 5. mqextproperty name, synonym, data type, and folderProperty synonym Property name Data type Folder JMSArmCorrelator mqext.Arm string<mqext><Arm>armCorrelator</Arm></mqext>JMSRMCorrelator mqext.Wrm string<mqext><Wrm>wrmCorrelator</Wrm></mqext>JMSDeliveryTime mqext.Dlt i8<mqext><Dlt>DeliveryTime</Dlt></mqext>JMSDeliveryDelay mqext.Dly i8<mqext><Dly>DeliveryTime</Dly></mqext>Do not add your own properties in the
mqextfolder. mqps-
mqpscontains properties that are used only by IBM MQ publish/subscribe. The folder is present only if the application has set at least one of the integrated publish/subscribe properties.Table 6. mqpsproperty name, synonym, data type, and folderProperty synonym Property name Data type Folder MQTopicString mqps.Top string<mqps><Top>topicString</Top></mqps>MQSubUserData mqps.Sud string<mqps><Sud>subscriberUserData...</Sud></mqps>MQIsRetained mqps.Ret boolean<mqps><Ret>isRetained</Ret></mqps>MQPubOptions mqps.Pub i8<mqps><Pub>publicationOptions</Pub></mqps>MQPubLevel mqps.Pbl i8<mqps><Pbl>publicationLevel</Pbl></mqps>MQPubTime mqpse.Pts string<mqps><Pts>publicationTime</Pts></mqps>MQPubSeqNum mqpse.Seq i8<mqps><Seq>publicationSequenceNumber</Seq></mqps>MQPubStrIntData mqpse.Sid string<mqps><Sid>publicationData</Sid></mqps>MQPubFormat mqpse.Pfmt i8<mqps><Pfmt>messageFormat</Pfmt></mqps>Do not add your own properties in the
mqpsfolder. mq_svc-
mq_svccontains properties used by SupportPacMA93.Do not add your own properties in the
mq_svcfolder. mqtt-
mqttcontains properties use by MQ TelemetryTable 7. mqtt property name, synonym, data type, and folder Property synonym Property name Data type Folder mqtt.clientIdstring<mqtt><clientId> topicString </clientId></mqtt>mqtt.qosi4<mqtt><qos> qualityOfService </qos></mqtt>mqtt.msgidstring<mqtt><msgid> messageIdentifier </msgid></mqtt>Do not add your own properties in the
mqttfolder.
A segmented message put with either MQMF_SEGMENT or
MQMF_SEGMENTATION_ALLOWED cannot contain an MQRFH2 with an
ungrouped property folder name. The MQPUT fails with reason code
2443, MQRC_SEGMENTATION_NOT_ALLOWED.
Name-value pairs
In the syntax diagram, Name-value pairs
describes the content of an ordinary folder. An
ordinary folder contains groups, and elements. An element is a name-value pair. A group contains
elements and other groups.
In terms of trees, elements are leaf nodes, and groups are internal nodes. An internal node, and the folder, which is the root node, can contain a mixture of internal nodes and leaf nodes. A node cannot be both an internal node and a leaf node at the same time; see Figure 2.
Properties
In the syntax diagram, Properties
describes the content of a property folder. A property
folder contains groups, and properties. A property is a name-value pair with an optional data type
attribute. A group contains properties and other groups.
In terms of trees, properties are leaf nodes, and groups are internal nodes. An internal node, and the property folder, which is the root node, can contain a mixture of internal nodes and leaf nodes. A node cannot be both an internal node and a leaf node at the same time; see Figure 2.
Property
A message property is a name-value pair in a property folder. It can optionally include a data type attribute and a property attribute; for an example, see the following code. If the data type attribute is omitted, the property type is string.
<pf><p1 dt='i8' > value </p1></pf>
<>
syntax, replaced by dots. For example,
myPropertyFolder1.myGroup1.myGroup2.myProperty1 is mapped to a
NameValueData string as follows. The string is formatted for
easier reading. <myPropertyFolder1>
<myGroup1>
<myGroup2>
<myProperty1>value</myProperty1>
</myGroup2>
</myGroup1>
</myPropertyFolder1>
A property folder can contain multiple properties. For example the properties in Figure 7 are mapped to the property folder in Changes to isolate the sales queue in a new cluster and separate the gateway cluster transmission queues.
myPropertyFolder1.myProperty4
myPropertyFolder1.myGroup1.myGroup2.myProperty1
myPropertyFolder1.myGroup1.myGroup2.myProperty2
myPropertyFolder1.myGroup1.myProperty3
<myPropertyFolder1>
<myProperty4>value</myProperty4>
<myGroup1>
<myGroup2>
<myProperty1>value</myProperty1>
<myProperty2>value</myProperty2>
</myGroup2>
<myProperty3>value</myProperty3>
</myGroup1>
</myPropertyFolder1>
Name
A name must begin with a Letter or an Underscore. It must
not contain a Colon, not end in a Period and contain only
Letters, Numerals, Underscores,
Hyphens, and Dots. Valid characters are defined in the W3C XML specification, and consist essentially of
Unicode categories Ll, Lu, Lo, Lt, Nl, Mc, Mn, Lm, and Nd ; see
Unicode character categories.
The complete path of a property or name-value pair must not break the rule described in Invalid path name. Paths are restricted to 4095 bytes, must not contain Unicode compatibility
characters, and must not start with the string XML.
Group name
A group name has the same syntax as a name. Group names are optional. Properties and name-value pairs can be placed in the root of a folder. Use groups if it helps to organize properties and name-value pairs.
Element name
An element name has the same syntax as a name.
Element value
An element value includes all the white space between the < Element
name > tag and the < /Element name >. Do
not use the two characters < and & in a value. Replace then
with < and &.
Property attributes
- Support
-
- sa (default)
MQPD_SUPPORT_OPTIONAL- sr
MQPD_SUPPORT_REQUIRED- sx
MQPD_SUPPORT_REQUIRED_IF_LOCAL
- Context
-
- none (default)
MQPD_NO_CONTEXT- user
MQPD_USER _CONTEXT
- CopyOptions
-
- forward
MQPD_COPY_FORWARD- reply
MQPD_COPY_REPLY- report
MQPD_COPY_REPORT- publish
MQPD_COPY_PUBLISH- all
MQPD_COPY_ALLDo not use all in combination with other options.
- default
MQPD_COPY_DEFAULTDo not use default in combination with other options. default is the same as forward + report + publish.
- none
MQPD_COPY_NONEDo not use none in combination with other options.
The Support property attributes are only applicable to properties in the mq folder.
The Context and CopyOptions property attributes are applicable to all property folders.
Data types
MQRFH2 data types map to message property types as follows:
MQRFH2 data type |
Message property type |
|---|---|
bin.hex |
MQBYTE[] |
boolean |
MQBOOL |
i1 |
MQINT8 |
i2 |
MQINT16 |
i4 |
MQINT32 |
i8 |
MQINT64 |
r4 |
MQFLOAT32 |
r8 |
MQFLOAT64 |
string |
MQCHAR[] |
Any element without a data type is assumed to be of type string.
xsi:nil='true'. Do not use
the attribute xsi:nil='false' for non-null values. For example, the following
property has a null value: <NullProperty
xsi:nil='true'></NullProperty>
MQRFH2 element with a zero length element value. For example, the following
property has an empty value: <EmptyProperty></EmptyProperty>
Reserved folder or property folder name
Restrict the name of a folder or property folder not to start with any of the following strings. The prefixes are reserved for folder or property names created by IBM.
Invalid path name
Restrict the complete path of a name-value pair or a property not to include any of the following strings.
Invalid characters
Always use the escape sequences & and < instead of
the literals
and &
. <
Defined property names
Defined property names are the names of properties that are defined by IBM MQ, or other products, and used by IBM MQ and user applications. Defined properties exist only in defined property folders. Defined property names are described in the description of property folders; see Property folders.
Invalid property name
Do not construct property names that match the following rule. The rule applies to the full property path that names a property, and not only to the property element name.
Invalid attributes
Property folders and properties can include only supported Property attributes and Data types.
Any non-supported XML-like attributes, for example, names with quoted string values, that are included in property folders or properties might be removed.
XML-like attributes included in non-property folders or non-property elements that remain in MQRFH2 headers.
