1 Reply Latest reply on Jul 13, 2012 6:00 AM by garytully

    INDIVIDUAL_ACKNOWLEDGE mode questions

    ingrid_ingrid.olson

      The following questions are related to messages received from calls to MessageConsumer.recieve() where the message consumer was created from a session whose mode is INDIVIDUAL_ACKNOWLEDGE:

       

      1. Is the message.acknowledge() method's implicit use of MessageConsumers and Sessions thread-safe?

       

      2. At what point does a message that is not acknowledged returned to its destination? Is there a way to explicitly return a received message back to a queue or topic?  Is there some sort of timeout that does this automatically if .acknowledge() is not called?

       

      3. Is the behavior of message.acknowledge() on a received message independent of subsequent messages being received on a message consumer.  Can a message be returned to its destination if later messages have been recieved and acknowledged on a message consumer?

        • 1. Re: INDIVIDUAL_ACKNOWLEDGE mode questions
          garytully
          ingrid wrote:

          The following questions are related to messages received from calls to MessageConsumer.recieve() where the message consumer was created from a session whose mode is INDIVIDUAL_ACKNOWLEDGE:

           

          1. Is the message.acknowledge() method's implicit use of MessageConsumers and Sessions thread-safe?

           

          No, only connections in JMS are thread safe

           

          2. At what point does a message that is not acknowledged returned to its destination? Is there a way to explicitly return a received message back to a queue or topic?  Is there some sort of timeout that does this automatically if .acknowledge() is not called?

           

          When the consumer is closed, unacknowledged messages are made available to other consumers.

          For transacted sessions, where onMessage results in an exception, the redelivery policy allows a message to be considered poison and candidates for DLQ processing. There is a new feature on trunk that will allow  broker side redelivery in that case, so before the consumer is closed. see: https://issues.apache.org/jira/browse/AMQ-3894

           

          3. Is the behavior of message.acknowledge() on a received message independent of subsequent messages being received on a message consumer.  Can a message be returned to its destination if later messages have been recieved and acknowledged on a message consumer?

          Yes