3 Replies Latest reply on Apr 24, 2013 10:41 AM by Gary Tully

    Issue with ActiveMQXAConnectionFactory and Fuse Fabric

    Chris Geer Newbie

      I have an existing application running on the vanilla Apache ServiceMix stack that I'm trying to get running on a JBoss Fuse ESB release using Fabric and having an issue with A-MQ using XA Transactions. So my baseline is that this application works fine on my current platform. When moving to Fabric I changed my connection string from connecting to an AMQ broker in the same VM to using the Fabric discovery (i.e. discovery:(fabric:default)). Whenever I use an ActiveMQXAConnectionFactory and I try to send a message the application just hangs forever. If I change it to use an ActiveMQConnectionFactory it all works as a champ (but I don't have XA transaction support which isn't what I want). Here are my two bean configs:

       

          <bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">

             <property name="brokerURL" value="discovery:(fabric:default)" />

              <property name="userName" value="mqconnection" />

              <property name="password" value="password" />

          </bean>

       

         

          <bean id="activemqConnectionFactoryXa" class="org.apache.activemq.ActiveMQXAConnectionFactory">

              <property name="brokerURL" value="discovery:(fabric:default)" />

              <property name="userName" value="mqconnection" />

              <property name="password" value="password" />

              <property name="redeliveryPolicy">

                  <bean class="org.apache.activemq.RedeliveryPolicy">

                      <property name="maximumRedeliveries" value="0"/>

                  </bean>

              </property>

          </bean>

       

      Something odd in the logs is that when I use the XA connection I start seeing messages like this which I don't see if I'm just using the non-XA connection:

       

      2013-04-22 05:55:07,000 | DEBUG | ActiveMQ Task-1  | FailoverTransport                | sport.failover.FailoverTransport  786 | 2242 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | urlList connectionList:[tcp://localhost:61616], from: [tcp://localhost:61616]

      2013-04-22 05:55:07,001 | DEBUG | ActiveMQ Task-1  | FailoverTransport                | sport.failover.FailoverTransport  990 | 2242 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Attempting  35th  connect to: tcp://localhost:61616

      2013-04-22 05:55:07,002 | DEBUG | ActiveMQ Task-1  | FailoverTransport                | sport.failover.FailoverTransport 1040 | 2242 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Connect fail to: tcp://localhost:61616, reason: java.net.ConnectException: Connection refused

      2013-04-22 05:55:07,002 | DEBUG | ActiveMQ Task-1  | TcpTransport                     | ivemq.transport.tcp.TcpTransport  520 | 2242 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Stopping transport tcp://localhost:61616

       

      I went through all my configs and code and can't find any references to localhost:61616 so I'm not sure where it's getting that from. My AMQ broker is being created by deploying the stock MQ profile to another container (so it's running in a different container than my application).

       

      I think this is my last roadblock in getting some portion of my application running on Fabric so any help is appreciated.

       

      Thanks,

      Chris

        • 1. Re: Issue with ActiveMQXAConnectionFactory and Fuse Fabric
          Gary Tully Novice

          that is odd.

          can you increase logging such that we can see the application of the bean properties. It seems as if the <property name="brokerURL" value="discovery:(fabric:default)" /> is not being applied. But one would expect an error in that case. 

          you are picking up the default broker url that is hard coded in the underlying factory: failover://tcp://localhost:61616

          • 2. Re: Issue with ActiveMQXAConnectionFactory and Fuse Fabric
            Chris Geer Newbie

            Gary,

             

            I finally figured out the issue but it doesn't really make sense to me based on the symptoms I was seeing. To fix the issue I changed my refernce to my XA Conenection Factory from

             

            <reference id="jmsCF" interface="org.apache.activemq.pool.XaPooledConnectionFactory"/>

             

            to

             

            <reference xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0" ext:proxy-method="classes" id="jmsCF" interface="org.apache.activemq.pool.XaPooledConnectionFactory"/>

             

            This makes sence given I'm trying to reference a class and not an interface however there are two things that don't make sense.

             

            1) Why I didn't get an error stating I couldn't reference a class (like I do in other places)

            2) Why this would cause a random JMS connection to the default broker url which wasn't running

             

            Chris


            • 3. Re: Issue with ActiveMQXAConnectionFactory and Fuse Fabric
              Gary Tully Novice

              on 1) blueprint should error out. Can you raise an issue to track that so we can fix that for a future release.

               

              on 2) I don't have an answer, something must be creating and referencing a connection factory, a little bit of remote debugging with a breakpoint in the creation method of ActiveMQConnectionFactory would track it down.