Failure to CreateQueueConnection across subnets - Not clustered
garneke11 Nov 13, 2012 12:36 PMFinally, 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.