6 Replies Latest reply on Mar 2, 2016 11:47 AM by jbertram

    How to limit concurrent MDB invocations with ActiveMQ

    thmayr

      Hi,

       

      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

       

      But this affects all queues, which is not what I need. So I configured the destination of the "low priority" MDB, which should consume only one message at a time, in the following way:
      <activation-config-property>

          <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