title: BackPressure in Spring Boot application
body: <p>I want to apply backpressure on my application webservice. So that if number of request is high say more than <code>N</code> I can notify the client. Below is my controller</p>
  
  <p>Before WebFlux</p>
  
  <pre><code>@RequestMapping(value = "/tasks", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity&lt;ResponseTaskModel&gt; taskForUser(@RequestParam(value = "userId", required = true) String userId,              
  @RequestParam(required = false) Map&lt;String, String&gt; userData) {
      ResponseTaskModel responseTaskModel = service.retrieveNextTaskForUser(userId.toLowerCase(), userData);
      return new ResponseEntity&lt;ResponseTaskModel&gt;(responseTaskModel, HttpStatus.OK);
  }
  </code></pre>
  
  <p>After WebFlux</p>
  
  <pre><code>@RequestMapping(value = "/tasks/v1", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
  public Mono taskForUserV1(@RequestParam(value = "userId", required = true) String userId,
                                                       @RequestParam(required = false) Map&lt;String, String&gt; userData) {
      return service.taskForUserV1(userId, userData);
  }
  </code></pre>
  
  <p>And the service method I am calling is a blocking call to db with three queries, I'm using a postgres database.</p>
  
  <p>Now how shall I apply backpressure on the <code>Mono</code> object returned?</p>