title: Netty with ReactorClientHttpConnector: How to set readTimeout, writeTimeout and connectTimeout without using deprecated tcpConfiguration
body: <p>Netty has deprecated the usage of <code>HttpClient#tcpConfiguration</code>. We are looking for a simple way how to configure:</p>
  <ul>
  <li>connectTimeout: How long to wait for a connection</li>
  <li>writeTimout: How long to wait for writing to the stream (if data cannot be delivered within this time frame, exception will be thrown)</li>
  <li>readTimeout: How long to wait to read from the stream (if data is not delivered within this time frame, exception will be thrown)</li>
  </ul>
  <p>The current code looks like this:</p>
  <pre class="lang-java prettyprint-override"><code>HttpClient httpClient = HttpClient.create();
  
  Integer connectTimeOutInMs = clientProperties.getConnectTimeOutInMs();
  Integer writeTimeOutInMs = clientProperties.getWriteTimeOutInMs();
  Integer readTimeout = clientProperties.getReadTimeOutInMs();
  
  httpClient = httpClient.tcpConfiguration(tcpClientParam -&gt; {
      TcpClient tcpClient = tcpClientParam;
      // Connect timeout configuration
      if (connectTimeOutInMs != null) {
          tcpClient = tcpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeOutInMs);
      }
      return tcpClient.doOnConnected(conn -&gt; {
          if (readTimeout != null) {
              conn.addHandlerLast(new ReadTimeoutHandler(readTimeout, TimeUnit.MILLISECONDS));
          }
          if (writeTimeOutInMs != null) {
              conn.addHandlerLast(new WriteTimeoutHandler(writeTimeOutInMs, TimeUnit.MILLISECONDS));
          }
      });
  });
  </code></pre>
  <p>How should this be configured without use of tcpConfiguration?  The following approach did not work as expected and ReadTimeout has not been thrown as expected.</p>
  <pre class="lang-java prettyprint-override"><code>Integer readTimeout = clientProperties.getReadTimeOutInMs();
  if (readTimeout != null) {
      httpClient.doOnConnected(c -&gt; c.addHandlerLast(new ReadTimeoutHandler(readTimeout, TimeUnit.MILLISECONDS)));
  }
  Integer writeTimeOutInMs = clientProperties.getWriteTimeOutInMs();
  if (writeTimeOutInMs != null) {
      httpClient.doOnConnected(
              c -&gt; c.addHandlerLast(new WriteTimeoutHandler(writeTimeOutInMs, TimeUnit.MILLISECONDS)));
  }
  Integer connectTimeout = clientProperties.getConnectTimeOutInMs();
  if (connectTimeout != null) {
      httpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeout);
  }
  </code></pre>
  <p>What would be the correct implementation? I saw that Netty offers <code>HttpClient#responseTimeout()</code>, which at the end sets <code>HttpClientOperations#addHandler(NettyPipeline.ResponseTimeoutHandler, new ReadTimeoutHandler(responseTimeout.toMillis(), TimeUnit.MILLISECONDS));</code>. But there are no methods for connect nor writeTimeouts.</p>