1 Reply Latest reply on Aug 3, 2014 10:20 AM by Doug Grove

    Limited number of MDB's to 10 using ActiveMQ

    Aleksandar Aleksovski Newbie

      Hi,


      I have problem with testing Jboss WildFly (also same is with 7.2).


      My application connects to activemq and works good, but number of mdb is limited to 10 sessions on particular queue.


      I checked all configurations and I try everything,  but no luck so far.




      RAR file for resource adapter is not modified.

       

      Standalon.xml: just part that is required for activemq configuration

       

              <subsystem xmlns="urn:jboss:domain:ejb3:2.0">

                  <session-bean>

                      <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>

                      <singleton default-access-timeout="5000"/>

                  </session-bean>

                  <mdb>

                      <resource-adapter-ref resource-adapter-name="activemq.ra"/>

                      <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

                  </mdb>

                  <pools>

                      <bean-instance-pools>

                          <strict-max-pool name="slsb-strict-max-pool" max-pool-size="31" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                          <strict-max-pool name="mdb-strict-max-pool" max-pool-size="32" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                      </bean-instance-pools>

                  </pools>

                  <caches>

                      <cache name="simple"/>

                      <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>

                  </caches>

                  <passivation-stores>

                      <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>

                  </passivation-stores>

                  <async thread-pool-name="default"/>

                  <timer-service thread-pool-name="default" default-data-store="default-file-store">

                      <data-stores>

                          <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>

                      </data-stores>

                  </timer-service>

                  <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>

                  <thread-pools>

                      <thread-pool name="default">

                          <max-threads count="22"/>

                          <keepalive-time time="100" unit="milliseconds"/>

                      </thread-pool>

                  </thread-pools>

                  <iiop enable-by-default="false" use-qualified-name="false"/>

                  <default-security-domain value="other"/>

                  <default-missing-method-permissions-deny-access value="true"/>

              </subsystem>

       

       

              <subsystem xmlns="urn:jboss:domain:resource-adapters:2.0">

                  <resource-adapters>

                      <resource-adapter id="activemq-ra.rar">

                          <archive>

                              activemq-ra.rar

                          </archive>

                          <transaction-support>NoTransaction</transaction-support>

                          <config-property name="ServerUrl">

                              tcp://127.0.0.1:61616

                          </config-property>

                          <connection-definitions>

                              <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/activemq/ConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionFactoryPool" use-ccm="true">

                                  <pool>

                                      <min-pool-size>1</min-pool-size>

                                      <max-pool-size>20</max-pool-size>

                                  </pool>

                              </connection-definition>

                          </connection-definitions>

                          <admin-objects>

                              <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/activemq/queue_out" enabled="true" use-java-context="true" pool-name="ActiveMQQueue.queue_out">

                                  <config-property name="PhysicalName">

                                      queue.queue_out

                                  </config-property>

                              </admin-object>

                              <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/activemq/queue_in" enabled="true" use-java-context="true" pool-name="ActiveMQQueue.queue_in">

                                  <config-property name="PhysicalName">

                                      queue.queue_in

                                  </config-property>

                              </admin-object>

                          </admin-objects>

                      </resource-adapter>

                  </resource-adapters>

              </subsystem>

      Example MDB:

       

      @MessageDriven(activationConfig = { 

             @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), 

             @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), 

             @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue.queue_out1") }) // Note the physical name of the queue 

      @ResourceAdapter("activemq-ra.rar")

      @TransactionManagement(value=TransactionManagementType.CONTAINER)   

      public class Consumer implements MessageListener {

       

        public Consumer() {

        }

       

        @Override

        public void onMessage(Message message) {

             try {

                  if (message instanceof TextMessage) {

                       System.out.println(" Got Message "+ ((TextMessage) message).getText());

                       long threadId = Thread.currentThread().getId();

                       System.out.println(threadId);

                       try {

                            Thread.sleep(5000);

                              //this sleep will provide max number of mdb's (or not? )

                             } catch (InterruptedException e) {

                                 // TODO Auto-generated catch block

                                 e.printStackTrace();

                              }

                       }

                  } catch (JMSException e) {

                       e.printStackTrace();

                  }

             }

      }

       

      From WilFly management model view :

       

      /deployment=Test-ejb-JMS.jar/subsystem=ejb3/message-driven-bean=Consumer

      {
        
      "component-class-name" => "Consumer",
        
      "declared-roles" => [],
        
      "delivery-active" => true,
        
      "execution-time" => 0L,
        
      "invocations" => 0L,
        
      "methods" => {},
        
      "peak-concurrent-invocations" => 0L,
        
      "pool-available-count" => 23,
        
      "pool-create-count" => 10,
        
      "pool-current-size" => 10,
        
      "pool-max-size" => 32,
        
      "pool-name" => "mdb-strict-max-pool",
        
      "pool-remove-count" => 0,
        
      "run-as-role" => undefined,
        
      "security-domain" => "other",
        
      "timers" => [],
        
      "wait-time" => 0L,
        
      "service" => undefined
      }

       

      Any suggestion why number of MDB is limited to 10 ???