This function confirms only a single MQeQMgrGetMsg or MQeQMgrPutMsg operation and not a set of them, therefore this API is not a unit-of-work function.
#include <hmq.h> MQEVOID MQeQMgrConfirmMsg( MQEHSESS hSess, MQECHAR * pQMName, MQECHAR * pQName, MQEINT32 Option, MQEHFIELDS hMsg, MQEINT32 * pCompCode, MQEINT32 * pReason)
If both options are set, then MQE_QMGR_OPTION_CONFIRM_GETMSG takes precedent.
The application has to call MQeFieldsFree() to free the message object handle.
#include <hmq.h> MQEHSESS hSess; MQCHAR * qm = "myQM"; MQCHAR * q = "QQ"; MQEHFIELDS hFilter = MQEHANDLE_NULL; MQEINT32 i, n, nMsgs; MQEINT32 compcode; MQEINT32 reason; MQEGMO gmo = MQEGMO_DEFAULT; hSess = MQeInitialize("MyAppsName", &compcode, &reason); /* Set up the GMO for confirm msg operation */ gmo.Options |= MQE_QMGR_OPTION_CONFIRMID; gmo.ConfirmId.hi = 0; gmo.ConfirmId.lo = 0x55aa; hMsg = MQeQMgrGetMsg( hSess, qm, q, &gmo, hFilter, &compcode, &reason); /* Process the message */ /* Confirms the message */ MQeQMgrConfirmMsg( hSess, qm, q, MQE_QMGR_OPTION_CONFIRM_GETMSG, hMsg, &compcode, &reason); MQeTerminate(hSess, &compcode, &reason);