The value passed as the confirmId parameter also has another use. The value is used to identify the message while it is locked and awaiting confirmation. If an error occurs during a get operation, it can potentially leave the message locked on the queue. This happens if the message is locked in response to the get command, but an error occurs before the application receives the message. If the application reissues the get in response to the exception, then it will be unable to obtain the same message because it is locked and invisible to MQe applications.
However, the application that issued the get command can restore the messages using the undo method. The application must supply the confirmId value that it supplied to the get message command. The undo command restores messages to the state they were in before the get command.
The undo command also has relevance for the mqeQueueManager_putMessage and mqeQueueManager_browseMessagesAndLock commands. As with get message, the undo command restores any messages locked by the mqeQueueManager_browseMessagesandLock command to their previous state.
If an application issues an undo command after a failed mqeQueueManager_putMessage command, then any message locked on the target queue awaiting confirmation is deleted.
The undo command works for operations on both local and remote queues.