title: How to properly return HttpStatus in Mono<ResponseEntity>?
body: <p>I have an api which returns some <code>HttpStatus</code> code. And based on the code the gatekeeper will perform some action. Following is just a skeleton of the API.</p>
  
  <pre><code>@GetMapping("/globalretry")
  public Mono&lt;ResponseEntity&gt; testGlobalRetryFilter(@RequestParam(name = "code") int code) {
      Map&lt;String, Object&gt; map = new LinkedHashMap&lt;&gt;();
      map.put("code", code);
      switch (code) {
          case 200:
              map.put("status", "SUCCESS");
              break;
          case 504:
              map.put("status", "RETRY: GATEWAY_TIMEOUT");
              break;
          default:
              map.put("status", "BAD_REQUEST");
              break;
      }
      return Mono.just(new ResponseEntity(map, HttpStatus.valueOf(code)));
  }
  </code></pre>
  
  <p>Now the problem is , if I return the response code in such way, then spring is not able to identify the status code from <code>Mono&lt;ResponseEntity&gt;</code>. Can any body help me on how to return the <code>statuscode</code> in a way thus spring can identify the response's status code</p>