4 Replies Latest reply on Nov 15, 2012 5:28 AM by ataylor

    Failure to CreateQueueConnection across subnets - Not clustered

    garneke11

      Finally, tracked my networking issue down to a hornetq configuration issue that makes no sense to me. 

      I need help understanding this.

       

      Senerio..

      Client and Server in this configuration has always worked for me on the same subnet!

      I need to run Client and Server on different subnets. 

      Need to work with both 2.0.0.GA and 2.2.14.Final ( both have same issue ).

      This is a stand-alone/non-clustered configuration.

       

      I define my Hornetq host in my startup script.

      It is defined as a name to be resolved via the hosts file.

       

      for example in my startup script...

      HOST=JMS_SERVER                                                     ( where JMS_SERVER is an alias for 192.16.3.19 )

      java args....  -Dhornetq.remoting.netty.host=${HOST}

       

       

      ======================

      1.)  I will present the configuration that does not work first!

      ======================

       

      Then my "hornetq-configuration.xml" file contains the following lines for the connector and acceptor...

       

         <connectors>

            <connector name="netty">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

               <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

            </connector>

         </connectors>

       

         <acceptors>

            <acceptor name="netty">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

               <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

            </acceptor>

         </acceptors>

       

      THIS DOES NOT WORK!

       

      if I run a `netstat -na | grep 1099`  the results look good.  I see that 192.16.3.19 is listening on port 1099.

       

      If I watch the network trace my client connects to the JMSServer and performs some handshaking then it stops and times-out.

       

      The java exception is...

      javax.jms.JMSException: Timed out waiting for response when sending packet 30

          at org.hornetq.core.remoting.impl.ChannelImpl.sendBlocking(ChannelImpl.java:270)

          at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:377)

          at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1063)

          at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:790)

          at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:558)

          at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:602)

          at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:128)

          at com.issinc.cds.sb.jms.JMSConnection.getJMSSession(JMSConnection.java:321)

          at com.issinc.cds.sb.jms.JMSConnection.getQueueSender(JMSConnection.java:407)

          at com.issinc.cds.sb.jms.JMSConnection.isJMSSendReady(JMSConnection.java:508)

          at com.issinc.cds.sbsend.dest.JMSDestSender.isConnectionReady(JMSDestSender.java:73)

          at com.issinc.cds.sbsend.dest.AbstractDestSender.assertConnectionReady(AbstractDestSender.java:247)

          at com.issinc.cds.sbsend.dest.AbstractDestSender.run(AbstractDestSender.java:94)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

          at java.util.concurrent.FutureTask.run(FutureTask.java:138)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

          at java.util.concurrent.FutureTask.run(FutureTask.java:138)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: HornetQException[errorCode=3 message=Timed out waiting for response when sending packet 30]

          ... 22 more

       

      =====================

      2.) This works.

      =====================

       

      If I change my "hornetq-configuration.xml" file to read this it works...

       

         <connectors>

            <connector name="netty">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

               <param key="host"  value="192.16.3.19"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

            </connector>

         </connectors>

       

         <acceptors>

            <acceptor name="netty">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

               <param key="host"  value="192.16.3.19"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

            </acceptor>

         </acceptors>

       

       

      Why does this work and the first not?

      Why do I have to hard code an IP Address?

      Why do aliases not work here?

      why, why, why?

       

       

      Please help me understand this.

       

      Thanks.

        • 1. Re: Failure to CreateQueueConnection across subnets - Not clustered
          gaohoward

          First I'd suggest you try latest version. A lot bug fixes /improvements since.

           

          I don't know exactly what's the problem but if your clients use a host alias to access the server, you might have problem because internally hornetq uses host names whenever it needs to compare two remoting configurations. But so far I have only seen the problem shown in some failover situations. Anyway this has been corrected in latest releases.

           

          Howard

          • 2. Re: Failure to CreateQueueConnection across subnets - Not clustered
            garneke11

            Thanks, but...

             

            I am using 2.2.14.Final. 

            I am not going to be premitted to run the 2.3.0 beta in production.

             

            I am seeing different but similar issues with 2.2.14.Final than with 2.0.0.GA. 

            The bottom line is that it works with aliases on the same subnet ( client and server on different hosts ).

            However, if I use an alias for the host ip it does not work across subnets.

             

            For me, this means that the hornetq server is no longer something I can just include in my distribution, now there is additional configuration that has to be done.

            minor, but in a large complex system it is just one more thing that can be overlooked or miss typed during an installation.

             

            I guess I have been fortunate that my installations have all been on the same subnet until now.

             

            I would view this as a bug. 

            Do you invision it getting fixed?

            • 3. Re: Failure to CreateQueueConnection across subnets - Not clustered
              clebert.suconic

              We recently have released an EAP version.. maybe you could get a git TAG, and verify if that's fixing the issue for you:

               

              this tag here: HornetQ_2_2_23_AS7_Final

              • 4. Re: Failure to CreateQueueConnection across subnets - Not clustered
                ataylor

                we don't do anything special, we just use an InetSocketAddress which will use the name service to look up the address.

                 

                also use '`netstat -na | grep 5445` not 1099 as this is port HornetQ uses.