How to limit concurrent MDB invocations with ActiveMQ
thmayr Mar 1, 2016 7:30 AMHi,
I need to limit the concurrent invocations of a MDB listening to a certain queue. I'm using WildFliy 10.0.0 with ActiveMQ 5.13.1. I tried already to set the <activation-config-properties> maxSession, minPoolSize and maxPoolSize to one without success:
<activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>1</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>minPoolSize</activation-config-property-name> <activation-config-property-value>1</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>maxPoolSize</activation-config-property-name> <activation-config-property-value>1</activation-config-property-value> </activation-config-property>
When I define the connection to the ActiveMQ broker in the following way, only one message is processed at a time by the MDB's connected to a queue (see http://activemq.apache.org/what-is-the-prefetch-limit-for.html):
tcp:
//localhost:61616?jms.prefetchPolicy.queuePrefetch=1
<activation-config-property-name>destination</activation-config-property-name>
<activation-config-property-value>de.adesso.tma.test.ejb.RequestQueue_LOW?consumer.prefetchSize=1</activation-config-property-value></activation-config-property>
This works as expected. But I wonder if this is the right way to do it. Are there any <activation-config-properties>, which can be used to achieve the same effect? Is there a documentation of all WildFly specific properties somewhere? I found only the following specification for the JBoss/WildFly specific deployment descriptor: https://docs.jboss.org/author/display/WFLY8/jboss-ejb3.xml+Reference.
Thanks for hints
Thomas