5 Replies Latest reply on Dec 2, 2013 9:18 PM by jbertram

    Message count per producer

    fuinhaazul

      Hi.

       

      In the last few days i´m facing a very big problem using hornetq version 2.2.14 standalone.

       

      I have 20 producers, sending messages to a queue.

      Reading that queue I just have one consumer.

       

      The problem is that one of those 20 producers, is a sending lot of unecessary messages to the queue, but I´m unable to discover witch one is.

       

      There is any message counter per producer? There is any way to discover this?

       

      Thanks in advance.

        • 1. Re: Message count per producer
          jbertram

          The HornetQServerControl has listProducersInfoAsJSON which I think you should be able to use to gain insight here.

          1 of 1 people found this helpful
          • 2. Re: Message count per producer
            fuinhaazul

            Yeap, this works, but only for online producers. If the producer close his connection then the information is lost (tested here).

             

            There is any way to count messages for that producer since hornetq last start/restart?

            • 3. Re: Message count per producer
              jbertram

              The information is volatile so what you are observing is expected.

               

              There isn't anything which collects that data for access after the producer is closed.

              • 4. Re: Message count per producer
                fuinhaazul

                I tried to implement some Interceptors (org.hornetq.api.core.Interceptor), but I can´t find a good documentation about all the packet types. 

                 

                There is any packet that can anwer something like ClientID and destination for each message?

                 

                Or, how can I get text body from org.hornetq.core.server.ServerMessage ? I tried with getBodyInputStream, but is empty. 

                 

                Something like this can helpme with these anwers.

                 

                Thanks Justin!

                • 5. Re: Message count per producer
                  jbertram

                  There is no documentation covering all the packet types.  If you've got the HornetQ source, just look for all the classes that implement org.hornetq.core.protocol.core.Packet.  You can also check out the interceptor example in the HornetQ distribution or the org.hornetq.tests.integration.InterceptorTest in the HornetQ source to see more about how to use interceptors.