If a failure occurs during step 1 in Put message - assured put, the application should retransmit the message. There is no danger of introducing duplicate messages into the MQe network since the message at the target queue manager is not made visible to applications until the confirm flow has been successfully processed.
If the MQe application retransmits the message, it should also inform the target queue manager that this is happening. The target queue manager deletes any duplicate copy of the message that it already has. The application sets the MQE_MSG_RESENDMQe.Msg_Resend field to do this.
If a failure occurs during step 2 in Put message - assured put, the application should send the confirm flow again. There is no danger in doing this since the target queue manager ignores any confirm flows it receives for messages that it has already confirmed. This is shown in the following example, taken from the example program examples.application.example6.