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.

Async configuration

Async configuration - Spring Tutorial

From the course: Spring Web MVC 6

Async configuration

- [Instructor] Let's see a quick demo for the asynchronous processing with Spring MVC. The first step, is to set up the Spring MVC task executor bean, so that it gets activated in our application. To do that, I'll open the BigStarCollectiblesApplication. And inside this, let's add the annotation bean, and let's tie it up to a method, called public Executor, which comes from java.util.concurrent. And let's name the bean as asyncExecutor. So in this, we are going to take an instance of ThreadPoolTaskExecutor. Now this is the one that's coming from the org.springframework.scheduling.concurrent package. So we're going to instantiate this. And let's set some properties to this bean. One is the CorePoolSize. I'm going to keep it very simple, so I'm just going to have two as the CorePoolSize. The other one is the MaxPoolSize. Let's keep that two as well. The next one will be the QueueCapacity. Let's set this to, let's…

Contents