0 Replies Latest reply on Feb 3, 2011 2:14 AM by cedrix_

    Bridge with LargeMessage hangs

    cedrix_

      Hello,

       

      I am performing some tests with connecting two queues with a bridge; with stand-alone non-clustered configuration.

       

      There is a “source” queue on one server and a “destination” on another remote server. The queues are connected with the bridge; pointing from the source to the destination. Producing messages into the source and consuming from the destination.

      If I disable the network connection, the bridge recognizes the connection failure, and deactivates itself. When I enable the connection after some minutes the bridge becomes connected and the messages appear on the destination.

       

      However when the same test is done with large messages, the reconnection is not performed. The messages remain in the source queue until I restart the server.

       

      I checked the bridge code (org.hornetq.core.server.cluster.impl.BridgeImpl) and what I could see is that when the connection error occured the following method method get blocked:

      “HandleStatus handle(final MessageReference ref)”

      At the line:

      “producer.send(dest, message)”

       

      The bridge is notified with the connection error but it can not set the activate flag to false since the handle method is synchronizing on the same object….

       

      As I see the problem is in the producer.send(dest, message) which blocks, I tried to set the JMS connection factory blocking settings to false but I encountered the same problem

      <block-on-durable-send>false</block-on-durable-send>

      <block-on-non-durable-send>false</block-on-non-durable-send>

       

      As I saw in case of large messages a different code is performed for the transfer and this can be a reason for the different behaviour.

       

      Do I still miss some configuration settings or is it possible that this issue is related to these issues?

       

      https://issues.jboss.org/browse/HORNETQ-520

      https://issues.jboss.org/browse/HORNETQ-571

      https://issues.jboss.org/browse/JBPAPP-5799

      http://community.jboss.org/message/530916#530916

       

       

       

      On the producer side I have the following configuration:

      JMS:

      <configuration xmlns="urn:hornetq"

                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                         xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

                  <queue name="source">

                              <entry name="/queue/source"/>

                  </queue>

      </configuration>

       

      HornetQ:

      <configuration xmlns="urn:hornetq"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

         <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:8000}"/>

            </connector>

                    <connector name="remote-connector">

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

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

                              <param key="port" value="8000"/>

            </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:8000}"/>

            </acceptor>

         </acceptors>

          <queues>  

            <queue name="jms.queue.source">

               <address>jms.queue.source</address>

            </queue>

        </queues>

         <bridges>

            <bridge name="my-bridge">

                <queue-name>jms.queue.source</queue-name>

                <forwarding-address>jms.queue.destination</forwarding-address>

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

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

             </bridge>

         </bridges>

         <security-settings>

            <security-setting match="#">

               <permission type="createNonDurableQueue" roles="guest"/>

               <permission type="deleteNonDurableQueue" roles="guest"/>

               <permission type="consume" roles="guest"/>

               <permission type="send" roles="guest"/>

            </security-setting>

         </security-settings>

      </configuration>

       

      On the consumer side:

      JMS:

      <configuration xmlns="urn:hornetq"

                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                         xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

                 

                  <queue name="destination">

                              <entry name="/queue/destination"/>

                  </queue>

                 

      </configuration>

       

      HornetQ:

      <configuration xmlns="urn:hornetq"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

         <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:8000}"/>

            </connector>

           </connectors>

      <acceptors>

            <acceptor name="netty">

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

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

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

            </acceptor>

         </acceptors>

         <security-settings>

            <security-setting match="#">

               <permission type="createNonDurableQueue" roles="guest"/>

               <permission type="deleteNonDurableQueue" roles="guest"/>

               <permission type="consume" roles="guest"/>

               <permission type="send" roles="guest"/>

            </security-setting>

         </security-settings>

      </configuration>

       

      Thank you.

       

      Cédric