title: spring boot webflux: avoid thread-blocking method calls in handler
body: <p>I am just getting started with <code>WebFlux</code> and the whole reactive paradigm and I am stuck on this:</p>
  
  <pre><code>@Component
  public class AbcHandler {
  
      private ObjectMapper objectMapper = new ObjectMapper();
  
      public Mono&lt;ServerResponse&gt; returnValue() throws IOException {
  
          Abc abc = objectMapper.readValue(new ClassPathResource("data/abc.json").getURL(), Abc.class);
  
          return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON)
                  .body(BodyInserters.fromValue(abc));
      }
  }
  </code></pre>
  
  <p>IntelliJ gives me warnings that <code>readValue()</code> and <code>toURL()</code> are thread-blocking method calls.</p>
  
  <p>Can I ignore this or how else am I supposed to return a JSON structure I am reading in from the file system and mapping to a domain class?</p>
  
  <p>I feel like this should somehow be done in an asynchronous manner or at least more "reactively".</p>