1 Reply Latest reply on Apr 11, 2011 12:47 PM by Clebert Suconic

    Core Bridge reconnection with Netty Servlet

    Fabrice D. Newbie

      Hi,

       

      I am working with the JBoss-6.0.0.Final so with HornetQ-2.1.2-Final.

      I am linking two HornetQ with CoreBridges, called here client and server.

       

      Here a snippet of my bridge configuration:

      {noformat}

      <bridge name="server.detection.nfc">

        <queue-name>jms.topic.server.detection</queue-name>

          <retry-interval>5000</retry-interval>

          <retry-interval-multiplier>1.0</retry-interval-multiplier>

          <reconnect-attempts>-1</reconnect-attempts>

          <use-duplicate-detection>true</use-duplicate-detection>

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

      </bridge>

      {noformat}

       

      With the usual Netty connector over TCP, it is working fine:

      if I start the client when the server is down, the client start fine.

      Once the server is started, I receive the messages.

      The second scenario is also ok:

      I shutdown the server, restart it, and the server receives the client messages.

       

      When I try to use the Netty connector over servlet, it does not work anymore:

      If I start the client while the server is stopped I have the following stack:

      {noformat}

      09:09:50,142 ERROR [org.hornetq.core.remoting.impl.netty.NettyConnector] Failed to create netty connection: java.net.SocketTimeoutException: connect timed out

                at java.net.PlainSocketImpl.socketConnect(Native Method) [:1.6.0_24]

                at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) [:1.6.0_24]

                at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) [:1.6.0_24]

                at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) [:1.6.0_24]

                at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432) [:1.6.0_24]

                at java.net.Socket.connect(Socket.java:529) [:1.6.0_24]

                at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:114) [:6.0.0.Final]

                at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:74) [:6.0.0.Final]

                at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) [:6.0.0.Final]

                at org.jboss.netty.channel.Channels.connect(Channels.java:541) [:6.0.0.Final]

                at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:217) [:6.0.0.Final]

                at org.jboss.netty.channel.socket.http.HttpTunnelingClientSocketChannel.connectReal(HttpTunnelingClientSocketChannel.java:152) [:6.0.0.Final]

                at org.jboss.netty.channel.socket.http.HttpTunnelingClientSocketPipelineSink.eventSunk(HttpTunnelingClientSocketPipelineSink.java:64) [:6.0.0.Final]

                at org.jboss.netty.channel.Channels.connect(Channels.java:541) [:6.0.0.Final]

                at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:217) [:6.0.0.Final]

                at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227) [:6.0.0.Final]

                at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188) [:6.0.0.Final]

                at org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:447) [:6.0.0.Final]

                at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:953) [:6.0.0.Final]

                at org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834) [:6.0.0.Final]

                at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342) [:6.0.0.Final]

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123) [:6.0.0.Final]

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:849) [:6.0.0.Final]

                at org.hornetq.core.server.cluster.impl.BridgeImpl.createObjects(BridgeImpl.java:671) [:6.0.0.Final]

                at org.hornetq.core.server.cluster.impl.BridgeImpl.access$800(BridgeImpl.java:71) [:6.0.0.Final]

                at org.hornetq.core.server.cluster.impl.BridgeImpl$CreateObjectsRunnable.run(BridgeImpl.java:784) [:6.0.0.Final]

                at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.0.0.Final]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]

                at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]

      {noformat}

      Then, once the server is started, there is not any message received by the server. I have to restart the client to restore the communication.

       

      Same behavior if I stop the server. On the client side I have a normal:

      {noformat}
      16:56:38,209 WARN  [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] Connection failure has been detected: The connection was disconnected because of server shutdown [code=4]
      {noformat}

       

      It seems that the Bridge reconnection does not work with servlet connector.

      I can use TCP but Servlet mode is great for simplifiing management and firewall configuration...

       

      Could someone have a clue of what I miss ?

       

      Kind regards,

      Fabrice