2 Replies Latest reply on Apr 18, 2013 8:53 AM by Morne Leroux

    Consumer-Max-Rate not working.

    Morne Leroux Newbie

      Hello guys.

       

      I have literally read every thread on this topic and still cannot get the consumer max rate to work.

       

      I am running JBoss AS 5.1 with HornetQ 2.1.2 (Colmeia).

       

      I am using MDB to consume messages so as I understand the  <consumer-max-rate>1</consumer-max-rate> attribute will not work when you put it hornetq-jms.xml because it actually uses the  resource adapter as connection factory.

       

      So as per other threads I added the consumer max rate global under resource adapter in hornetq-ra.rar/META-INF/ra.xml

       

      Like so :

       

      <config-property>

          <description>The consumer max rate</description>

          <config-property-name>ConsumerMaxRate</config-property-name>

          <config-property-type>java.lang.Integer</config-property-type>

          <config-property-value>1</config-property-value>

      </config-property>

       

      And in my MDB I added :

       

      @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1"),

      @ActivationConfigProperty(propertyName = "consumerMaxRate", propertyValue = "1")

       

      and also in my MDB :

       

      @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=1, timeout=10000)

       

       

      My problem is however, that when I print out the time when a message was sent and when the message was consumed, I find that all my messages are still being sent and consumed in the same second... therefore I cannot understand why it's not working?

       

       

      13:11:26,068 FATAL [VendorImpl] Sent message: 0013001727006 Time of send:  13:11:26

      13:11:26,120 FATAL [WebServiceMDB] Received message: 0013001727002 Time of receive: 13:11:26

      13:11:26,120 FATAL [WebServiceMDB] ---------------------------------------------------------

      13:11:26,366 FATAL [VendorImpl] Sent message: 0013001727007 Time of send:  13:11:26

      13:11:26,384 FATAL [WebServiceMDB] Received message: 0013001727003 Time of receive:  13:11:26

       

       

      Can you guys think of anything im doing wrong? Am I missing something else?

       

      Any help will be greatly appreciated!

       

      Kind Regards

        • 1. Re: Consumer-Max-Rate not working.
          Andy Taylor Master

          can you try with the latest version, 2.1.2 is quite old and we have fixed a lot of things since then.

           

          My problem is however, that when I print out the time when a message was sent and when the message was consumed, I find that all my messages are still being sent and consumed in the same second... therefore I cannot understand why it's not working?

           

          you mean consumed in the same second don't you, sending has nothing to do with consumerMaxRate

          • 2. Re: Consumer-Max-Rate not working.
            Morne Leroux Newbie

            Correct Andy, the maximum amount of messages I saw consumed in the same second was 5.

             

            I am only interested in the time between when the messages are consumed.

             

            The system I am talking to has transactions per second requirement we need to adhere to, the max consumer rate would be perfect for this, however I cannot seem to get it working.

             

            From reading other threads related to max consumer rate, I am unsure if my consumer is actually working as it should or not at all, my results indicate that more than 1 message per second is being consumed, sometimes even as high as 5 messages per second.

             

            I shall try the latest version and see if my results differ, thanks Andy.