0

While making the following call http://localhost:8080/test for the the TestController I was not able to get more the 6 responses from the server in parallel. The requests just keep waiting for the request I made before to finish. Is there a way to increase this number per API(Controller)?

TestController

@RestController
@RequestMapping("/test")
class TestController() {


    @GetMapping(produces = [MediaType.TEXT_EVENT_STREAM_VALUE])
    fun test(): Flux<String> {
        return Flux
                .interval(Duration.ofSeconds(1))
                .map { t ->  "test $t"}

    }
}

Number of CPUs in the machine running the application: 8

1 Answers1

2

I'm assuming you're calling your server from an internet browser. Max 6 connections to a domain is a known browser limitation. HTTP/2 or WebSocket can offer a solution.

Martin Tarjányi
  • 8,863
  • 2
  • 31
  • 49
  • Oh my god I forgot about this one! One more thing I want to point it out is, because Chrome, Opera and Edge use the same engine I had to use Firefox in order to get more connections in the same computer. – Rafael Ferreira Rocha May 02 '20 at 17:23