title: Spring WebFlux not streaming response
body: <p>I was expecting this code to stream events to the client (code is in Kotlin but Java is very similar)</p>
  
  <pre><code>@RestController
  object CustomerController {
      @GetMapping("/load", produces = arrayOf("application/stream+json"))
      fun load(): Flux&lt;String&gt; {
          var flux = Flux.fromIterable(ResultIterable())
          flux.subscribe({println(it)})
          return flux
      }
  }
  </code></pre>
  
  <p>ResultIterable is an iterable that generates a string on regular intervals. An infinite stream basically.</p>
  
  <p>I don't see any output, it hangs forever.</p>
  
  <p>I do see the string being printed on regular intervals (println(it)).</p>
  
  <p>I am using the following curl:</p>
  
  <pre><code>curl -X GET   http://localhost:8080/load   -H 'accept: application/stream+json'   -H 'cache-control: no-cache'   -H 'content-type: application/stream+json'
  </code></pre>