Kbase 19639: SonicMQ: When is a Message Removed from the Queue
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/15/2000 |
|
A message is removed from the message queue when it is given
to a consumer. It is held in a list of messages which are waiting for
acknowledgments. If an acknowledgment does not arrive, the message
is placed back in the queue.
If the connection is closed while 'onMessage' is processing a message,
the 'onMessage' is allowed to finish and the message is acknowledged
before the close can proceed.
If the close occurs before the 'onMessage' starts but after the
Broker has sent the message to the client, the message is placed back in the queue (since the message will not be acknowledged).
If the client connection is closed via Ctrl/C, the sequence of events
depends upon whether or not the acknowledgment has reached the Broker.
Since Ctrl/C processing is handled by the JVM, the delivery thread
might be interrupted after 'onMessage()' has executed, but before the acknowledgment is sent. The Broker will detect that the connection has been dropped and the message will be placed back in the queue.