title: set timeout in Spring WebFlux webclient
body: <p>I'm using Spring Webflux WebClient to make a REST call from my Spring boot application. And every time getting a timeout in 30 seconds.</p>
  
  <p>Here is some code I tried to set socket timeout in WebClient of Spring webfulx.</p>
  
  <pre><code> - ReactorClientHttpConnector connector = new ReactorClientHttpConnector(options -&gt; options
             .option(ChannelOption.SO_TIMEOUT, 600000).option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 600000));
   - ReactorClientHttpConnector connector = new ReactorClientHttpConnector(
             options -&gt; options.afterChannelInit(chan -&gt; {
                  chan.pipeline().addLast(new ReadTimeoutHandler(600000));
              }));
   - ReactorClientHttpConnector connector1 = new ReactorClientHttpConnector(options -&gt; options
              .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 600000).afterNettyContextInit(ctx -&gt; {
                  ctx.addHandlerLast(new ReadTimeoutHandler(600000, TimeUnit.MILLISECONDS));
              }));
  </code></pre>
  
  <p>And tried to add this above connector setting in “WebClient” by using “clientConnector” method.</p>
  
  <p>And also tried to set timeout as below:</p>
  
  <pre><code>webClient.get().uri(builder -&gt; builder.path("/result/{name}/sets")
                      .queryParam("q", "kind:RECORDS")
                      .queryParam("offset", offset)
                      .queryParam("limit", RECORD_COUNT_LIMIT)
                      .build(name))
              .header(HttpHeaders.AUTHORIZATION, accessToken)
              .exchange().timeout(Duration.ofMillis(600000))
              .flatMap(response -&gt; handleResponse(response, name, offset));
  </code></pre>
  
  <p>None of the above options is working for me.</p>
  
  <p>I'm using org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M7 which interally have dependecy of org.springframework:spring-webflux:5.0.2.RELEASE.</p>
  
  <p>Please suggest here and let me know if I'm doing anything wrong here.</p>