title: Reactive WebClient not emitting a response
body: <p>I have a question about Spring Reactive WebClient...
  Few days ago I decided to play with the new reactive stuff in Spring Framework and I made one small project for scraping data only for personal purposes. (making multiple requests to one webpage and combining the results).</p>
  
  <p>I started using the new reactive WebClient for making requests but the problem I found is that the client not emitting response for every request. Sounds strange. Here is what I did for fetching data:
  </p>
  
  <pre><code>private Mono&lt;String&gt; fetchData(String uri) {
      return this.client
              .get()
              .uri(uri)
              .header("X-Fsign","SW9D1eZo")
              .retrieve()
              .bodyToMono(String.class)
              .timeout(Duration.ofSeconds(35))
              .log("category", Level.ALL, SignalType.ON_ERROR, SignalType.ON_COMPLETE, SignalType.CANCEL, SignalType.REQUEST);
  }
  </code></pre>
  
  <p>And the function that calls <code>fetchData</code>:
  </p>
  
  <pre><code>public Mono&lt;List&lt;Stat&gt;&gt; fetch() {
      return fetchData(URL)
              .map(this::extractUrls)
              .doOnNext(System.out::println)
              .doOnNext(s-&gt; System.out.println("all ids are "+s.size()))
              .flatMapIterable(q-&gt;q)
              .map(s -&gt; s.substring(7, 15))
              .map(s -&gt; "http://d.flashscore.com/x/feed/d_hh_" + s + "_en_1") // list of N-length urls
              .flatMap(this::fetchData)
              .map(this::extractHeadToHead)
              .collectList();
  }
  </code></pre>
  
  <p>and the subscriber:</p>
  
  <pre><code>    FlashScoreService bean = ctx.getBean(FlashScoreService.class);
      bean.fetch().subscribe(s-&gt;{
          System.out.println("finished !!! " + s.size()); //expecting same N-length list size
      },Throwable::printStackTrace);
  </code></pre>
  
  <p>The problem is if I made a little bit more requests > 100.
   I didn't get responses for all of them, no error is thrown or error response code is returned and subscribe method is invoked with size different from the number of requests.</p>
  
  <p>The requests I made are  based on List of Strings (urls) and after all responses are emitted I should receive all of them as list because I'm using <code>collectList()</code>. When I execute 100 requests, I expect to receive list of 100 responses but actually I'm receiving sometimes 100, sometimes 96 etc ... May be something fails silently.
   This is easy reproducible here is my github project <a href="https://github.com/nickolayrusev/flashscore-stats-reactive" rel="noreferrer">link</a>.</p>
  
  <p>Sample output:</p>
  
  <pre><code>all ids are 176
  finished !!! 171
  </code></pre>
  
  <p>Please give me suggestions how I can debug or what I'm doing wrong. Help is appreciated.</p>
  
  <p>Update:</p>
  
  <p>The log shows if I pass 126 urls for example:</p>
  
  <pre><code>onNext(ReactorClientHttpResponse{request=[GET/some_url],status=200}) is called 121 times. May be here is the problem.
  onComplete() is called 126 times which is the exact same length of the passed list of urls
  </code></pre>
  
  <p>but how it's possible some of the requests to be completed without calling onNext() or onError( ) ? (success and error in Mono)</p>
  
  <p>I think the problem is not in the WebClient but somewhere else. Environment or server blocking the request, but may be I should receive some error log.</p>
  
  <p>ps. Thanks for the help !</p>