From the course: Spring Web MVC 6
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Spring MVC async processing under the hood - Spring Tutorial
From the course: Spring Web MVC 6
Spring MVC async processing under the hood
- [Instructor] In order to make the asynchronous request processing work with Spring MVC, your controller methods are going to look a little different. By far, we always had controller methods returning a string value, but now the methods can return either a callable of string or a deferred result of string, and we'll see this when we do our demo. Let's understand how asynchronous processing works. Let's say there is an incoming request, request one, and the server container creates a thread, thread one, and allocates it to this request processing. This means that the dispatcher servlet and all its associated filters are in action. Let's say that this request needs to do a blocking call. at this point, thread one will delegate all its responsibility to an asynchronous execution context. This also means that at this point, the dispatcher servlet and all its associated filters will actually exit, but the response is still kept…