MDREP (10-digit signed integer)
Options for report messages.
A report message is a message about another message, used to inform an application about expected or unexpected events that relate to the original message. The MDREP field enables the application sending the original message to specify which report messages are required, whether the application message data is to be included in them, and also (for both reports and replies) how the message and correlation identifiers in the report or reply message are to be set. Any or all (or none) of the following types of report message can be requested:
- Exception
- Expiration
- Confirm on arrival (COA)
- Confirm on delivery (COD)
- Positive action notification (PAN)
- Negative action notification (NAN)
If more than one type of report message is required, or other report options are needed, the values can be added together (do not add the same constant more than once).
The application that receives the report message can determine the reason the report was generated by examining the MDFB field in the MQMD; see the MDFB field for more details.
Exception options: We can specify one of the options listed below to request an exception report message.
- ROACTIVITY
Activity reports required
This report option enables an activity report to be generated, whenever a message with this report option set is processed by supporting applications.
Messages with this report option set must be accepted by any queue manager, even if they do not 'understand' the option. This allows the report option to be set on any user message, even if they are processed by back level queue managers. To achieve this, the report option is placed in the MQRO_ACCEPT_UNSUP_MASK subfield.
If a process (either a queue manager or a user process) performs an Activity on a message with MQRO_ACTIVITY set, it can choose to generate and put an activity report.
The activity report option allows the route of any message to be traced throughout a queue manager network. The report option can be specified on any current user message and instantly they can begin to calculate the route of the message through the network. If the application generating the message cannot switch on activity reports, it can be turned on by using an API crossing exit supplied by queue manager administrators.
Several conditions are applicable to activity reports:
- The route will be less detailed if there are fewer queue managers in the network which are able to generate activity reports.
- The activity reports may not be easily 'orderable' in order to determine the route taken.
- The activity reports may not be able to find a route to their requested destination.
- ROEXC
- Exception reports required.
This type of report can be generated by a message channel agent when a message is sent to another queue manager and the message cannot be delivered to the specified destination queue. For example, the destination queue or an intermediate transmission queue might be full, or the message might be too big for the queue.
Generation of the exception report message depends on the persistence of the original message, and the speed of the message channel (normal or fast) through which the original message travels:
- For all persistent messages, and for nonpersistent messages traveling through normal message channels, the exception report is generated only if the action specified by the sending application for the error condition can be completed successfully. The sending application can specify one of the following actions to control the disposition of the original message when the error condition arises:
- RODLQ (this causes the original message to be placed on the dead-letter queue).
- RODISC (this causes the original message to be discarded).
If the action specified by the sending application cannot be completed successfully, the original message is left on the transmission queue, and no exception report message is generated.
- For nonpersistent messages traveling through fast message channels, the original message is removed from the transmission queue and the exception report generated even if the specified action for the error condition cannot be completed successfully. For example, if RODLQ is specified, but the original message cannot be placed on the dead-letter queue because (say) that queue is full, the exception report message is generated and the original message discarded.
Refer to the WebSphere MQ Intercommunication book for more information about normal and fast message channels.
An exception report is not generated if the application that put the original message can be notified synchronously of the problem by means of the reason code returned by the MQPUT or MQPUT1 call.
Applications can also send exception reports, to indicate that a message that it has received cannot be processed (for example, because it is a debit transaction that would cause the account to exceed its credit limit).
Message data from the original message is not included with the report message.
Do not specify more than one of ROEXC, ROEXCD, and ROEXCF.
- ROEXCD
- Exception reports with data required.
This is the same as ROEXC, except that the first 100 bytes of the application message data from the original message are included in the report message. If the original message contains one or more MQ header structures, they are included in the report message, in addition to the 100 bytes of application data.
Do not specify more than one of ROEXC, ROEXCD, and ROEXCF.
- ROEXCF
- Exception reports with full data required.
This is the same as ROEXC, except that all of the application message data from the original message is included in the report message.
Do not specify more than one of ROEXC, ROEXCD, and ROEXCF.
Expiration options: We can specify one of the options listed below to request an expiration report message.
- ROEXP
- Expiration reports required.
This type of report is generated by the queue manager if the message is discarded prior to delivery to an application because its expiry time has passed (see the MDEXP field). If this option is not set, no report message is generated if a message is discarded for this reason (even if one of the ROEXC* options is specified).
Message data from the original message is not included with the report message.
Do not specify more than one of ROEXP, ROEXPD, and ROEXPF.
- ROEXPD
- Expiration reports with data required.
This is the same as ROEXP, except that the first 100 bytes of the application message data from the original message are included in the report message. If the original message contains one or more MQ header structures, they are included in the report message, in addition to the 100 bytes of application data.
Do not specify more than one of ROEXP, ROEXPD, and ROEXPF.
- ROEXPF
- Expiration reports with full data required.
This is the same as ROEXP, except that all of the application message data from the original message is included in the report message.
Do not specify more than one of ROEXP, ROEXPD, and ROEXPF.
Confirm-on-arrival options: We can specify one of the options listed below to request a confirm-on-arrival report message.
- ROCOA
- Confirm-on-arrival reports required.
This type of report is generated by the queue manager that owns the destination queue, when the message is placed on the destination queue. Message data from the original message is not included with the report message.
If the message is put as part of a unit of work, and the destination queue is a local queue, the COA report message generated by the queue manager becomes available for retrieval only if and when the unit of work is committed.
A COA report is not generated if the MDFMT field in the message descriptor is FMXQH or FMDLH. This prevents a COA report being generated if the message is put on a transmission queue, or is undeliverable and put on a dead-letter queue.
Do not specify more than one of ROCOA, ROCOAD, and ROCOAF.
- ROCOAD
- Confirm-on-arrival reports with data required.
This is the same as ROCOA, except that the first 100 bytes of the application message data from the original message are included in the report message. If the original message contains one or more MQ header structures, they are included in the report message, in addition to the 100 bytes of application data.
Do not specify more than one of ROCOA, ROCOAD, and ROCOAF.
- ROCOAF
- Confirm-on-arrival reports with full data required.
This is the same as ROCOA, except that all of the application message data from the original message is included in the report message.
Do not specify more than one of ROCOA, ROCOAD, and ROCOAF.
Discard and expiry options: We can specify the option below to set the expiry time and discard flag for report messages.
- ROPDAE
- Set report message expiry time and discard flag.
This option ensures that report messages and reply messages inherit the expiry time and discard flag (whether to discard or not), from their original messages. With this option set, report and reply messages:
- Inherit the MQRO_DISCARD_MSG flag (if it was set).
- Inherit the remaining expiry time of the message, if the message is not an expiry report. If the message is an expiry report, the expiry time is set to 60 seconds.
With this option set, the following applies:
Notes:
- Report and reply messages are generated with a discard flag and an expiry value, and cannot remain within the system.
- Trace route messages are prevented from reaching destination queues on non-trace route enabled queue managers.
- Queues are prevented from being filled with reports that cannot be delivered, if communications links are broken.
- Command server responses inherit the remaining expiry of the request.
Confirm-on-delivery options: We can specify one of the options listed below to request a confirm-on-delivery report message.
- ROCOD
- Confirm-on-delivery reports required.
This type of report is generated by the queue manager when an application retrieves the message from the destination queue in a way that causes the message to be deleted from the queue. Message data from the original message is not included with the report message.
If the message is retrieved as part of a unit of work, the report message is generated within the same unit of work, so that the report is not available until the unit of work is committed. If the unit of work is backed out, the report is not sent.
A COD report is not generated if the MDFMT field in the message descriptor is FMDLH. This prevents a COD report being generated if the message is undeliverable and put on a dead-letter queue.
ROCOD is not valid if the destination queue is an XCF queue.
Do not specify more than one of ROCOD, ROCODD, and ROCODF.
- ROCODD
- Confirm-on-delivery reports with data required.
This is the same as ROCOD, except that the first 100 bytes of the application message data from the original message are included in the report message. If the original message contains one or more MQ header structures, they are included in the report message, in addition to the 100 bytes of application data.
If GMATM is specified on the MQGET call for the original message, and the message retrieved is truncated, the amount of application message data placed in the report message is the minimum of:
- The length of the original message
- 100 bytes.
ROCODD is not valid if the destination queue is an XCF queue.
Do not specify more than one of ROCOD, ROCODD, and ROCODF.
- ROCODF
- Confirm-on-delivery reports with full data required.
This is the same as ROCOD, except that all of the application message data from the original message is included in the report message.
ROCODF is not valid if the destination queue is an XCF queue.
Do not specify more than one of ROCOD, ROCODD, and ROCODF.
Action-notification options: We can specify one or both of the options listed below to request that the receiving application send a positive-action or negative-action report message.
- ROPAN
- Positive action notification reports required.
This type of report is generated by the application that retrieves the message and acts upon it. It indicates that the action requested in the message has been performed successfully. The application generating the report determines whether or not any data is to be included with the report.
Other than conveying this request to the application retrieving the message, the queue manager takes no action based upon this option. It is the responsibility of the retrieving application to generate the report if appropriate.
- RONAN
- Negative action notification reports required.
This type of report is generated by the application that retrieves the message and acts upon it. It indicates that the action requested in the message has not been performed successfully. The application generating the report determines whether or not any data is to be included with the report. For example, it may be desirable to include some data indicating why the request could not be performed.
Other than conveying this request to the application retrieving the message, the queue manager takes no action based upon this option. It is the responsibility of the retrieving application to generate the report if appropriate.
Determination of which conditions correspond to a positive action and which correspond to a negative action is the responsibility of the application. However, it is recommended that if the request has been only partially performed, a NAN report rather than a PAN report should be generated if requested. It is also recommended that every possible condition should correspond to either a positive action, or a negative action, but not both.
Message-identifier options: We can specify one of the options listed below to control how the MDMID of the report message (or of the reply message) is to be set.
- RONMI
- New message identifier.
This is the default action, and indicates that if a report or reply is generated as a result of this message, a new MDMID is to be generated for the report or reply message.
- ROPMI
- Pass message identifier.
If a report or reply is generated as a result of this message, the MDMID of this message is to be copied to the MDMID of the report or reply message.
If this option is not specified, RONMI is assumed.
Correlation-identifier options: We can specify one of the options listed below to control how the MDCID of the report message (or of the reply message) is to be set.
- ROCMTC
- Copy message identifier to correlation identifier.
This is the default action, and indicates that if a report or reply is generated as a result of this message, the MDMID of this message is to be copied to the MDCID of the report or reply message.
- ROPCI
- Pass correlation identifier.
If a report or reply is generated as a result of this message, the MDCID of this message is to be copied to the MDCID of the report or reply message.
If this option is not specified, ROCMTC is assumed.
Servers replying to requests or generating report messages are recommended to check whether the ROPMI or ROPCI options were set in the original message. If they were, the servers should take the action described for those options. If neither is set, the servers should take the corresponding default action.
Disposition options: We can specify one of the options listed below to control the disposition of the original message when it cannot be delivered to the destination queue. These options apply only to those situations that would result in an exception report message being generated if one had been requested by the sending application. The application can set the disposition options independently of requesting exception reports.
- RODLQ
- Place message on dead-letter queue.
This is the default action, and indicates that the message should be placed on the dead-letter queue, if the message cannot be delivered to the destination queue. An exception report message will be generated, if one was requested by the sender.
- RODISC
- Discard message.
This indicates that the message should be discarded if it cannot be delivered to the destination queue. An exception report message will be generated, if one was requested by the sender.
If it is desired to return the original message to the sender, without the original message being placed on the dead-letter queue, the sender should specify RODISC with ROEXCF.
Default option: We can specify the following if no report options are required:
- RONONE
- No reports required.
This value can be used to indicate that no other options have been specified. RONONE is defined to aid program documentation. It is not intended that this option be used with any other, but as its value is zero, such use cannot be detected.
General information:
- All report types required must be specifically requested by the application sending the original message. For example, if a COA report is requested but an exception report is not, a COA report is generated when the message is placed on the destination queue, but no exception report is generated if the destination queue is full when the message arrives there. If no MDREP options are set, no report messages are generated by the queue manager or message channel agent (MCA).
Some report options can be specified even though the local queue manager does not recognize them; this is useful when the option is to be processed by the destination queue manager. See Appendix D. Report options and message flags for more details.
If a report message is requested, the name of the queue to which the report should be sent must be specified in the MDRQ field. When a report message is received, the nature of the report can be determined by examining the MDFB field in the message descriptor.
- If the queue manager or MCA that generates a report message is unable to put the report message on the reply queue (for example, because the reply queue or transmission queue is full), the report message is placed instead on the dead-letter queue. If that also fails, or there is no dead-letter queue, the action taken depends on the type of the report message:
- If the report message is an exception report, the message which caused the exception report to be generated is left on its transmission queue; this ensures that the message is not lost.
- For all other report types, the report message is discarded and processing continues normally. This is done because either the original message has already been delivered safely (for COA or COD report messages), or is no longer of any interest (for an expiration report message).
Once a report message has been placed successfully on a queue (either the destination queue or an intermediate transmission queue), the message is no longer subject to special processing; it is treated just like any other message.
- When the report is generated, the MDRQ queue is opened and the report message put using the authority of the MDUID in the MQMD of the message causing the report, except in the following cases:
- Exception reports generated by a receiving MCA are put with whatever authority the MCA used when it tried to put the message causing the report. The CDPA channel attribute determines the user identifier used.
- COA reports generated by the queue manager are put with whatever authority was used when the message causing the report was put on the queue manager generating the report. For example, if the message was put by a receiving MCA using the MCA's user identifier, the queue manager puts the COA report using the MCA's user identifier.
Applications generating reports should normally use the same authority as they would have used to generate a reply; this should normally be the authority of the user identifier in the original message.
If the report has to travel to a remote destination, senders and receivers can decide whether or not to accept it, in the same way as they do for other messages.
- If a report message with data is requested:
- The report message is always generated with the amount of data requested by the sender of the original message. If the report message is too big for the reply queue, the processing described above occurs; the report message is never truncated in order to fit on the reply queue.
- If the MDFMT of the original message is FMXQH, the data included in the report does not include the MQXQH. The report data starts with the first byte of the data beyond the MQXQH in the original message. This occurs whether or not the queue is a transmission queue.
- If a COA, COD, or expiration report message is received at the reply queue, it is guaranteed that the original message arrived, was delivered, or expired, as appropriate. However, if one or more of these report messages is requested and is not received, the reverse cannot be assumed, since one of the following may have occurred:
- The report message is held up because a link is down.
- The report message is held up because a blocking condition exists at an intermediate transmission queue or at the reply queue (for example, the queue is full or inhibited for puts).
- The report message is on a dead-letter queue.
- When the queue manager was attempting to generate the report message, it was unable to put it on the appropriate queue, and was also unable to put it on the dead-letter queue, so the report message could not be generated.
- A failure of the queue manager occurred between the action being reported (arrival, delivery or expiry), and generation of the corresponding report message. (This does not happen for COD report messages if the application retrieves the original message within a unit of work, as the COD report message is generated within the same unit of work.)
Exception report messages may be held up in the same way for reasons 1, 2, and 3 above. However, when an MCA is unable to generate an exception report message (the report message cannot be put either on the reply queue or the dead-letter queue), the original message remains on the transmission queue at the sender, and the channel is closed. This occurs irrespective of whether the report message was to be generated at the sending or the receiving end of the channel.
- If the original message is temporarily blocked (resulting in an exception report message being generated and the original message being put on a dead-letter queue), but the blockage clears and an application then reads the original message from the dead-letter queue and puts it again to its destination, the following may occur:
- Even though an exception report message has been generated, the original message eventually arrives successfully at its destination.
- More than one exception report message is generated in respect of a single original message, since the original message may encounter another blockage later.
Report messages for message segments:
- Report messages can be requested for messages that have segmentation allowed (see the description of the MFSEGA flag). If the queue manager finds it necessary to segment the message, a report message can be generated for each of the segments that subsequently encounters the relevant condition. Applications should therefore be prepared to receive multiple report messages for each type of report message requested. The MDGID field in the report message can be used to correlate the multiple reports with the group identifier of the original message, and the MDFB field used to identify the type of each report message.
- If GMLOGO is used to retrieve report messages for segments, be aware that reports of different types may be returned by the successive MQGET calls. For example, if both COA and COD reports are requested for a message that is segmented by the queue manager, the MQGET calls for the report messages may return the COA and COD report messages interleaved in an unpredictable fashion. This can be avoided by using the GMCMPM option (optionally with GMATM). GMCMPM causes the queue manager to reassemble report messages that have the same report type. For example, the first MQGET call might reassemble all of the COA messages relating to the original message, and the second MQGET call might reassemble all of the COD messages. Which is reassembled first depends on which type of report message happens to occur first on the queue.
- Applications that themselves put segments can specify different report options for each segment. However, the following points should be noted:
- If the segments are retrieved using the GMCMPM option, only the report options in the first segment are honored by the queue manager.
- If the segments are retrieved one by one, and most of them have one of the ROCOD* options, but at least one segment does not, it will not be possible to use the GMCMPM option to retrieve the report messages with a single MQGET call, or use the GMASGA option to detect when all of the report messages have arrived.
- In an MQ network, it is possible for the queue managers to have differing capabilities. If a report message for a segment is generated by a queue manager or MCA that does not support segmentation, the queue manager or MCA will not by default include the necessary segment information in the report message, and this may make it difficult to identify the original message that caused the report to be generated. This difficulty can be avoided by requesting data with the report message, that is, by specifying the appropriate RO*D or RO*F options. However, be aware that if RO*D is specified, less than 100 bytes of application message data may be returned to the application which retrieves the report message, if the report message is generated by a queue manager or MCA that does not support segmentation.
Contents of the message descriptor for a report message: When the queue manager or message channel agent (MCA) generates a report message, it sets the fields in the message descriptor to the following values, and then puts the message in the normal way.
Field in MQMD Value used MDSID MDSIDV MDVER MDVER2 MDREP RONONE MDMT MTRPRT MDEXP EIULIM MDFB As appropriate for the nature of the report (FBCOA, FBCOD, FBEXP, or an RC* value) MDENC Copied from the original message descriptor MDCSI Copied from the original message descriptor MDFMT Copied from the original message descriptor MDPRI Copied from the original message descriptor MDPER Copied from the original message descriptor MDMID As specified by the report options in the original message descriptor MDCID As specified by the report options in the original message descriptor MDBOC 0 MDRQ Blanks MDRM Name of queue manager MDUID As set by the PMPASI option MDACC As set by the PMPASI option MDAID As set by the PMPASI option MDPAT ATQM, or as appropriate for the message channel agent MDPAN First 28 bytes of the queue manager name or message channel agent name. For report messages generated by the IMS bridge, this field contains the XCF group name and XCF member name of the IMS system to which the message relates. MDPD Date when report message is sent MDPT Time when report message is sent MDAOD Blanks MDGID Copied from the original message descriptor MDSEQ Copied from the original message descriptor MDOFF Copied from the original message descriptor MDMFL Copied from the original message descriptor MDOLN Copied from the original message descriptor if not OLUNDF, and set to the length of the original message data otherwise An application generating a report is recommended to set similar values, except for the following:
- The MDRM field can be set to blanks (the queue manager will change this to the name of the local queue manager when the message is put).
- The context fields should be set using the option that would have been used for a reply, normally PMPASI.
Analyzing the report field: The MDREP field contains subfields; because of this, applications that need to check whether the sender of the message requested a particular report should use one of the techniques described in Analyzing the report field.
This is an output field for the MQGET call, and an input field for the MQPUT and MQPUT1 calls. The initial value of this field is RONONE.