by Garry F Carroll » Wed Nov 21, 2018 2:44 pm
Not so tough.
First, to ensure that the MQ message survives across a possible restart of the MQ Queue Manager, the message should be persistent. This is set at the time the message is put to the queue. Non-persistent messages are lost on Queue Manager restart.
Next, your Cobol program that gets (not reads) the message must get the message in syncpoint (MQGMO-SYNCPOINT) so that, in the event of a failure, the message is reinstated on the queue. If the get is with MQGMO-NO-SYNCPOINT, the message cannot be reinstated. On successful processing of the message (or set of messages) a commit is to be issued.
Finally, to ensure that a bad message does not result in an infinite loop of retries, the program should check the message's backoutcount and take appropriate action if this exceeds a pre-determined threshold.
Garry.