1 Reply Latest reply on Jan 17, 2011 12:16 PM by Clebert Suconic

    consumer ack/commit when not closing session

    Rudi Wirth Newbie

      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