Message acknowledgment
Every session that is not transacted has an acknowledgment mode that determines how messages received by the application are acknowledged. Three acknowledgment modes are available, and the choice of acknowledgment mode affects the design of the application.
XMS uses the same mechanism for acknowledging the receipt of messages that JMS uses.
- XMSC_AUTO_ACKNOWLEDGE
- The session automatically acknowledges each message received by the application.
- XMSC_DUPS_OK_ACKNOWLEDGE
- The session acknowledges the messages received by the application at times it selects.
- XMSC_CLIENT_ACKNOWLEDGE
- The application acknowledges the messages it receives by calling the Acknowledge method of the Message class.
In conjunction with any of these acknowledgment modes, an application can stop and restart the delivery of messages in a session by calling the Recover method of the Session class. Messages whose receipt was previously unacknowledged are redelivered. However, they might not be delivered in the same sequence in which they were previously delivered. In the meantime, higher priority messages might have arrived, and some of the original messages might have expired. In the point-to-point domain, some of the original messages might have been consumed by another application.
An application can determine whether a message is being re-delivered by examining the contents of the JMSRedelivered header field of the message. The application does this by calling the Get JMSRedelivered method of the Message class.