Consumer-Max-Rate not working.
nexus021 Apr 18, 2013 7:14 AMHello 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