Async Spring Controllers vs normal Controllers Async Spring Controllers vs normal Controllers spring spring

Async Spring Controllers vs normal Controllers


@DaveSyer is right, /api/2 is actually behaving as expected.

I assume you are testing the behavior with a web browser. At least Firefox and Chrome are preventing multiple simultaneous requests to the same URL. If you open 2 tabs with api/2, the second one will only send a request to the application after the first got the response.

Try testing it with a simple bash script, like:

curl localhost/api/2 &curl localhost/api/2 &curl localhost/api/2 &

It will print 3 responses around the same time.