title: Spring webflux difference between block, flatmap and subscribe
body: <p>I have an api which needs to call 3 other apis, the second and third api calls rely on the result of the first.</p>
  
  <p>I'm slightly confused about the best way to do this and the difference between using block, subscribe and flatmap. All 3 of these methods work for me but I am not sure which one is the best one to use.</p>
  
  <p>This is what I currently have:</p>
  
  <pre><code>webClient1.getApi1(request.getId())
     .subscribe(api1Response -&gt; {
        if (api1Response.hasData()) {
           Mono&lt;ApiTwoResponse&gt; monoTwo = webClient2
              .post()
              .syncBody(...)
              .bodyToMono(ApiTwoResponse.class)
           monoTwo.subscribe(two -&gt; log.info(two));
  
           Mono&lt;ApiThreeResponse&gt; monoThree = webClient3
              .put()
              .syncBody(...)
              .bodyToMono(ApiThreeResponse.class)
           monoThree.subscribe(three -&gt; log.info(three));
        } 
  });
  </code></pre>
  
  <p>I've also tried block although this seems to be discouraged:</p>
  
  <pre><code>Api1Response response = webClient1.getApi1(request.getId()).block()
  </code></pre>
  
  <p>and i also tried flatmap although this forces you to return something:</p>
  
  <pre><code>webClient1.getApi1(request.getId())
     .flatmap(api1Response -&gt; {
        ...
        return Mono.empty();
  });
  </code></pre>
  
  <p>Any help and feedback on the above code is appreciated.</p>