I have two simple controllers:
@GetMapping(value = "/simple-get")
public String simpleGet() {
return "simple Get";
}
@GetMapping(path = "/stream-flux", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<String> streamFlux() {
return Flux.interval(Duration.ofSeconds(2))
.map(sequence -> "Flux - " + LocalTime.now().toString());
}
When calling the first one, it works as expected (locally and remotely using an ip of a different machine). But when calling the second one, it works as expected using localhost e.g.: http://localhost:65465/stream-flux but it does not work remotely when deployed to a different machine using its ip. I even checked and it does not work locally when using 127.0.0.1 which is very strange.. all things that does not work with web-flux, works as expected with the simple-get API so I rule out connection problems..Couldn't find anything about it anywhere.. would appreciate any thoughts on this.