title: Does spring integration's tcp-inbound-channel-adapter and tcp-connection-factory have failover support?
body: <p>I have a simple tcp client using spring integration that takes in a message, and writes it to file.</p>
  <p>I want the client to connect by default to thing.input.primary.host, but in the event of a connection failure, I want it to reconnect to thing.input.secondary.host, and then send the message on like normal; is there support in spring integration for this behavior?</p>
  <p>Edit: for clarity.  What I'd like to do, is to have it switch from thingClient to thingClientSecondary, if thingClient fails.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xmlns:int=&quot;http://www.springframework.org/schema/integration&quot;
         xmlns:int-ip=&quot;http://www.springframework.org/schema/integration/ip&quot;
         xmlns:int-file=&quot;http://www.springframework.org/schema/integration/file&quot;
         xmlns=&quot;http://www.springframework.org/schema/beans&quot;
         xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
              http://www.springframework.org/schema/integration          http://www.springframework.org/schema/integration/spring-integration.xsd
              http://www.springframework.org/schema/integration/ip       http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd
              http://www.springframework.org/schema/integration/file     http://www.springframework.org/schema/integration/file/spring-integration-file.xsd&quot;&gt;
  
      &lt;int-ip:tcp-inbound-channel-adapter
              id=&quot;thingInGateway&quot;
              connection-factory=&quot;thingClientPrimary&quot;
              channel=&quot;fileOutputChain&quot;
              client-mode=&quot;true&quot;
              auto-startup=&quot;true&quot;
              retry-interval=&quot;1000&quot;/&gt;
  
      &lt;int-ip:tcp-connection-factory
              id=&quot;thingClientPrimary&quot;
              type=&quot;client&quot;
              host=&quot;${thing.input.primary.host}&quot;
              port=&quot;${thing.input.primary.port}&quot;
              deserializer=&quot;thingSerializer&quot;
              serializer=&quot;thingSerializer&quot;
              socket-support=&quot;thingSocketSupport&quot;
              so-keep-alive=&quot;true&quot;
              using-nio=&quot;true&quot;/&gt;
  
      &lt;int-ip:tcp-connection-factory
              id=&quot;thingClientSecondary&quot;
              type=&quot;client&quot;
              host=&quot;${thing.input.secondary.host}&quot;
              port=&quot;${thing.input.secondary.port}&quot;
              deserializer=&quot;thingSerializer&quot;
              serializer=&quot;thingSerializer&quot;
              socket-support=&quot;thingSocketSupport&quot;
              so-keep-alive=&quot;true&quot;
              using-nio=&quot;true&quot;/&gt;
      &lt;int:chain input-channel=&quot;fileOutputChain&quot; &gt;
          &lt;int-file:outbound-channel-adapter directory=&quot;${thing.output.directory}&quot;/&gt;
      &lt;/int:chain&gt;
  
  &lt;/beans&gt;
  </code></pre>