title: How to push message to upstream using reactive Flux/Mono whenever they are ready than polling in interval for status?
body: <p>Trying to push message to upstream whenever they are available/ready and close connection after flush, rather than polling for message using spring reactive flux interval.</p>
  
  <pre><code>@GetMapping(value = "/getValue/{randomId}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
  public Flux&lt;String&gt; statusCheck(@PathVariable("randomId") @NonNull String randomId) {
  
  return Flux.&lt;String&gt;interval(Duration.ofSeconds(3))
                  .map(status -&gt; {
                      if (getSomething(randomId).
                              equalsIgnoreCase("value"))
                          return "value";
                      return "ping";
                  }).take(Duration.ofSeconds(60)).timeout(Duration.ofSeconds(60));
      }
  </code></pre>
  
  <p>Kafka listener updates randomId value in a map as it gets, getSomething method checks for randomId value in intervals in map. So instead of checking in intervals and storing data in map, i want to push message to client when listener receives.</p>