2 Replies Latest reply on Apr 13, 2012 10:38 AM by Viacheslav Krot

    HornetQ pool configuration

    Viacheslav Krot Newbie

      Hello all,

       

      Could anyone help me to configure HornetQ in JBoss7? The problem is following:

      I've configured all queues and topics, it works most of the time, but in some parts of the code I get ResourceException when trying to open new session (Unable to get managed connection for java:/eflatbed.connectionfactory).

      It says that timeout occured during waiting for connection, default timeout is 30sec, thread coult - 20. How do I increase that count? I increased thread pool size in server config, but it seems to be some other pool:

       

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.1">

                  <hornetq-server>

                      <clustered>true</clustered>

                      <persistence-enabled>true</persistence-enabled>

                      <thread-pool-max-size>100</thread-pool-max-size>

                                              ...

       

      So I still see that pool size is equal to 20 during debug. Pool name is HornetQConnectionDefinition.

      How can I increase max pool size?

      Let me know if any other information could help.

       

      And one more question: do I need transaction mode "xa"? If I use some jdbc resource from MDB and have persistant queues, than it should be "xa"?

       

       

      Thank you in advance. 

        • 1. Re: HornetQ pool configuration
          Viacheslav Krot Newbie

          I found how pool configuration is created in the code. Configuration is stored in org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration object, it is initialized in org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer#createPoolConfiguration(CommonPool pp, CommonTimeOut tp, CommonValidation vp), common pool implementation comes from org.jboss.as.messaging.jms.PooledConnectionFactoryService#createConnDef, and that has following code:

           

          CommonPoolImpl pool = new CommonPoolImpl(null, null, false, false, FlushStrategy.FAILING_CONNECTION_ONLY);

           

          that means that PoolConfiguration#maxSize always has default value, 20, and setMaxSize is never called.

           

          Is that a bug? Should there be some configuration property, or did I miss something?

           

          p.s. what tag highlights source code? there is no special when replying.

          • 2. Re: HornetQ pool configuration
            Viacheslav Krot Newbie

            The question was answerd in HornetQ forum:

             

            There was a bug preventing to set the min/max size for JMS pooled connection factory that has been recently fixed in AS7 https://issues.jboss.org/browse/AS7-4330.