1 Reply Latest reply on Jan 17, 2011 12:16 PM by clebert.suconic

    consumer ack/commit when not closing session

    rudiwirth

      Hi everyone,

       

      I've modified one of the hornet core API examples (attached) to reproduce something that I ran into by accident:

      * separate session for producer and consumer, both transacted sessions

      * producer send and commit

      * consumer receive, ack, commit

      * then, do not close the sessions. just exit

       

      If I run it once, the hornet broker mbean for the queue shows

      * "consumer count = 1", makes sense because session was never closed by client

      * "message count = 1", despite the above ack/commit

       

      run app again before broker cleans up session:

      * send, now 2 messages on queue

      * receive() can not receive a message until broker clears the session

       

      If I wait until the broker cleans up the session and then run the send/receive app again, all messages are consumed.

       

      If I use non-transacted sessions, it never dequeues anyhting from the queue, ever.

       

      What I don't understand is why a tx'd receive-ack-commit doesn't dequeue the message.

       

      Thanks much for any insight!

       

      Rudi

        • 1. consumer ack/commit when not closing session
          clebert.suconic

          The consumer will still be on the Queue until TTL clears the connection. On that case the broker will still distribute messages to the queue.

           

           

          This is explained at the user's manual. Read the chapter about the TTL.

           

           

          BTW: I will move this thread to the user's forum. I see no reason to have it on the dev's forum.