4 Replies Latest reply on Nov 18, 2010 10:46 AM by davidcole

    How to set a Core Bridge initial wait timeout when using a Discovery Group?

    davidcole

      We have successfully set up a core bridge which uses a discovery-group to locate the bridged servers.

      Our issue is that the bridged servers must be started first before starting the server that has the bridge configuration.

       

      I am trying to figure out how to configure the bridge or discovery group so that on startup, the bridge will retry or wait for a timeout period before giving up and disabling the bridge. Currently, as soon as the bridge configured server is started, it will log a message, saying:

       

      12:27:02,064 WARN  [BridgeImpl] Bridge BackendCluster-MessageBridge is unable to connect to des
      tination. It will be disabled.

       

      The relevant part of our hornetq-configuration follows:

       

      <discovery-groups>
        <discovery-group name="qabatch-discovery-group">
          <group-address>231.6.47.47</group-address>
          <group-port>9886</group-port>
          <refresh-timeout>10000</refresh-timeout>
        </discovery-group>
      </discovery-groups>
      
      <bridges>
        <bridge name="BackendCluster-MessageBridge">
          <queue-name>jms.queue.mplus.BridgeOutboundQueue</queue-name>
          <forwarding-address>jms.queue.mplus.BridgeInboundQueue</forwarding-address>
          <retry-interval>1000</retry-interval>
          <retry-interval-multiplier>1.0</retry-interval-multiplier>
          <reconnect-attempts>-1</reconnect-attempts>
          <failover-on-server-shutdown>false</failover-on-server-shutdown>
          <use-duplicate-detection>true</use-duplicate-detection>
          <confirmation-window-size>10000000</confirmation-window-size>
          <discovery-group-ref discovery-group-name="qabatch-discovery-group" />
          <!--<connector-ref connector-name="bridge"/>-->
        </bridge>
      </bridges>
      
      

       

      I have seen in the documentation that you can set a discovery-group-ref and discovery-initial-wait-timeout on a connection-factory within the hornetq-jms.xml similar to this:

       

      <connection-factory name="BridgeConnectionFactory">
           <discovery-group-ref discovery-group-name="qabatch-discovery-group"/>
           <discovery-initial-wait-timeout>3600000</discovery-initial-wait-timeout>
      </connection-factory>
      
      

       

      However, this seemed to have no effect for on startup.

      Could someone provide some direction on how to properly configure the bridge using a discovery-group, such that the bridge startup will wait for the servers on the other end of the bridge to be started, without disabling the bridge? Any information or direction would be a great help!

       

      Thanks in advance,
      Dave

       

      P.S.

      Attached are both of my current configuration files.

        • 1. Re: How to set a Core Bridge initial wait timeout when using a Discovery Group?
          davidcole

          I have not been able to find any documentation or information that would help to solve this. Does anyone have any information or direction that would help?

           

          Thanks again,
          David Cole

          • 2. Re: How to set a Core Bridge initial wait timeout when using a Discovery Group?
            timfox

            It's not a common use case to use UDP for discovering bridge targets, so I don't know if this works. Bridges are usually used over WANs, internet etc where UDP is not usually available.

             

            Also, we're currently making improvements to HA as discussed on the dev forum, at which point we'll make sure it works ok.

            • 3. Re: How to set a Core Bridge initial wait timeout when using a Discovery Group?
              davidcole

              Hi Tim,

               

              We have chosen to use the core bridge option for our deployment scenario mainly because the documentation recommends using the core bridge option over the JMS bridge when possible for performance reasons. It's worked out very well for us with the exception of this one issue regarding server startup ordering; extremely fast and reliable once connected.

               

              Let me give you just a brief description of our deployment layout and maybe you could suggest the best approach for us in the current HornetQ version, or whether we should keep our current configuration and wait for the pending enhancements to address our issue.

               

              We have 2 clusters of JBoss application (AS 5) server's, a front-end cluster of 4 servers and a back-end cluster of 2 servers. The front-end cluster servers handle all incoming traffic and most common processing. We have the 2 back-end servers in a separate cluster, tasked to handle only long running or recurring processes. Users can start a process within our application, which will be initiated by the front-end cluster. If the process is one that has been targeted to be run on the back-end cluster, it will be redirected to a special queue (BridgeOutboundQueue is shown in the posted config) that the core bridge is configured to listen to. The message will be bridged to the back-end cluster's BridgeInboundQueue, where it is picked up and forwarded to the appropriate destination, and as a result, the process will run completely on the back-end cluster.

               

              So, it's basically a very simple setup that uses the strengh of the bridge configuration to direct JMS traffic to a separate cluster of servers completely transparent to the application and is able to leverage the discovery-group configuration to locate the the back-end servers dynamically on startup...if they are available. Pretty powerful stuff.

               

              Based on what I have described, do you think have we chosen the best option, or is there a better setup we should take into consideration?

               

              Thanks for any and all input,

              David Cole

              • 4. Re: How to set a Core Bridge initial wait timeout when using a Discovery Group?
                davidcole

                Tim,

                 

                Do you expect that HornetQ released with JBoss AS 6 will include this functionality?

                 

                Thanks,
                David Cole