5 Replies Latest reply on Feb 19, 2014 5:54 PM by Justin Bertram

    Consumer session lost

    Keven Wang Newbie

      Hi all,

       

      We are using JMS on EAP6/Jbossas 7 together with consumer flow control function. In our case, we use MDB with auto-acknowledgment. Then we specify max session as 1 on MDB to be able the control the flow, when handle the message, MDB/consumer sends an out going HTTP request to another server, then sleeps a while to make sure it only handles limited message per sec, then finish the onMessage method. Just recently we observe that one the out going HTTP server is not reachable, the consumer will be lost, it stops to consume any message from queue. We can see that at the beginning when external HTTP server is not reachable, the onMessage still returns successfully, but after a while, the no more MDB enters onMessage method any more.

       

      Do you have anyway what is possible root cause?

       

      Thank you very much!

        • 1. Re: Consumer session lost
          Justin Bertram Master

          My first thought is that your HTTP call is blocking when the server is not reachable and that is preventing the MDB from consuming further messages.

           

          In any event, I think that once you observe this problem you'd need to get a few thread dumps to investigate further.

          • 2. Re: Consumer session lost
            Keven Wang Newbie

            Hi Justin,

             

            Thank you for your answer. The HTTP calls happens inside onMessage method, and from the log we can see that last time it returns from onMessage method, and this time it never enters into onMessage method. So i thought it has sth to do with Hornetq, somehow the consumer session is lost or sucked before triggers MDB or after triggers MDB.

            Yes, of course the thread dump is useful, but this problem has on customer site twice and they are not able to provide us the dump, then we are still not able to reproduce it in design env.


            BR/Keven

            • 3. Re: Consumer session lost
              Justin Bertram Master

              You can check the consumerCount for the queue where the MDB is listening to ensure the MDB's session is still active.

              • 4. Re: Consumer session lost
                Keven Wang Newbie

                Hi Justin,

                 

                Ok, i will. What happens if consumerCount becomes 0? Does it mean the consumer is lost/dead? Do you know in what case consumer could die?

                 

                Thx.

                 

                BR/Keven

                • 5. Re: Consumer session lost
                  Justin Bertram Master

                  What happens if consumerCount becomes 0? Does it mean the consumer is lost/dead?

                  If the consumerCount is 0 that means that the MDB's session died for some reason.

                   

                   

                  Do you know in what case consumer could die?

                  Such a scenario is not simple enough to provide a list of definitive cases where it might happen.  Further investigation would be required, preferably with a reproducible test-case.

                   

                  BTW, what version of HornetQ is being used?