The message acknowledgment protocol is the key to guaranteed messaging, and support for acknowledgment is required by the semantics of the JMS API. This section provides an in-depth explanation of how the acknowledgment protocol works and its role in guaranteed messaging.
We will begin by examining the
mode. We will revisit this discussion later as it pertains to
, and JMS transacted messages. An understanding of the
basic concepts of
AUTO_ACKNOWLEDGE will make it
easy to grasp the fundamental concepts of the other modes.
The acknowledgment mode is set on a JMS provider when a
Session is created:
tSession = tConnect.createTopicSession(false,
Session.CLIENT_ACKNOWLEDGE); qSession = qConnect.createQueueSession(false,
We'll look at the
mode from the perspective of a message
producer, the message
server, and the message consumer.
Under the covers, the
methods are synchronous. These methods are responsible for sending the message and blocking until an acknowledgment is received from the message server. Once an acknowledgment has been received, the thread of execution resumes and the method returns; processing continues as normal. The underlying acknowledgment is not visible to the client programming model. If a failure condition occurs during this operation, an exception ...