There are 2 different features available:
servlet 3.0 allows to process request in a thread different from the container thread.
servlet 3.1 allows to read/write into socket without blocking reading/writing thread
There are a lot of examples in the internet about servlet 3.0 feature. We can use it in Spring very easily. We just have to return DefferedResult or CompletableFuture
But I can't find example of usage servlet 3.1 in spring. As far as I know we have to register WriteListener and ReadListener and do dome dirty work inside. But I can't find the example of that Listeners. I believe it is not very easy.
Could you please provide example of servlet 3.1 feature in spring with explanation of Listener implementaion ?
If you're looking for an example of Spring/Servlet 3.1 non-blocking HTTP API declaration, try the following:
Requires Spring Web 5.0+ and Servlet 3.1 support at Servlet Container level (Tomcat 8.5+, Jetty 9.4+, WildFly 10+)