2 Replies Latest reply on Nov 6, 2013 3:49 PM by ronsi

    How to set transaction mode to XA in connection-factory?

    ronsi

      I'm using JBOSS EAP 6.1.0.Final (Red Hat Version) and need to set transaction type for the connection factory I have defined. Below is how my configuration look like:

       

      Exception I'm getting is:

       

      HQ122010: Failed to connect JMS Bridge: java.lang.IllegalArgumentException: Connection factory must be XAConnectionFactory

       

      Connection Configuration:

      <jms-connection-factories>

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="netty"/>

                              </connectors>

                              <entries>

                                  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>

                              </entries>

                          </connection-factory>

                          <pooled-connection-factory name="hornetq-ra">

                             <! NOTE: Setting transaction mode here DOES NOT work -->

                              <transaction mode="xa"/>

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/JmsXA"/>

                              </entries>

                          </pooled-connection-factory>

      </jms-connection-factories>

        • 1. Re: How to set transaction mode to XA in connection-factory?
          jbertram

          Based on the error, I assume you're attempting to set up a JMS bridge in EAP 6.1 using ONCE_AND_ONLY_ONCE quality-of-service (since that is the only mode that requires XAConnectionFactory implementations).  If so, you should be aware that the bridge should not use a pooled-connection-factory but rather a normal JMS connection factory.  If you want to configure a normal JMS connection factory to support XA then use something like this:

           

                              <connection-factory name="InVmXAConnectionFactory">
                                  <factory-type>XA_GENERIC</factory-type>
                                  <connectors>
                                      <connector-ref connector-name="in-vm"/>
                                  </connectors>
                                  <entries>
                                      <entry name="java:/XAConnectionFactory"/>
                                  </entries>
                              </connection-factory>
          

           

          Also, you'll need to ensure that the other side of the bridge uses an XAConnectionFactory implementation as well.

          • 2. Re: How to set transaction mode to XA in connection-factory?
            ronsi

            Exactly what I was looking for. Thanks Justin.