3 Replies Latest reply on May 16, 2008 11:41 AM by Adrian Brock

    Resource adaptor and clustered connection factories (with JB

    Samuel Fruchter Newbie

      Hello,

      I posted the link below here because JBM guys told me that is a JCA issue.

      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143460#4143460

      The JMS-RA is used for having JTA aspects (managed tx).

        • 1. Re: Resource adaptor and clustered connection factories (wit
          Vicky Kak Master

          The JMS RA in Jboss basically pools the JmsSession which is of type javax.jms.Session . If this JMSSession is associted with the clustered ConnecitonFactory then the invocation from this session object would be delegated to appropriate ConnectionFactory

          JBoss Messaging has "connection load balancing" - this means that if you use a connection factory with the attribute "supportsLoadBalancing" set to true, then subsequent create connection attempts will be made on different nodes of the cluster in a round robin fashion, the first node is chosen randomly.

          This gives an even distribution of connections across the cluster.

          This is explained here
          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133370

          As per my understanding the load-balancing should basically be controlled by the configured ConnectionFactory in jms-ds.xml file .
          <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>

          So if this reference points to the clustered CF I understand the load balanding should work .


          BTW , there is failover feature can that can be configured in datasource descriptor , this is not possible with jms and it does not provide the load balancing feature
          http://wiki.jboss.org/wiki/JBossJCADatabaseFailover

          • 2. Re: Resource adaptor and clustered connection factories (wit
            Samuel Fruchter Newbie

            Yes but the problem is that the connections in the pool are reused.

            For example, if I open and close a connection 3 times in my bean code. The same connection will be reused the 3 times and then not roundrobined ...

            • 3. Re: Resource adaptor and clustered connection factories (wit
              Adrian Brock Master

               

              "sameuh" wrote:
              Yes but the problem is that the connections in the pool are reused.

              For example, if I open and close a connection 3 times in my bean code. The same connection will be reused the 3 times and then not roundrobined ...


              This is a feature of the jboss jca pool under low load.
              It tries to minimize the number of open connections to reduce resources
              by reusing connections on an MRU (most recently used) basis.

              This allows it to more easily spot when it can close "idle" - i.e. unnecessary connections
              in the pool for the load.

              If your usage of the connections are not overlapping then there is no need for it
              to create more than one connection in the pool.