Class AsyncSupportConfigurer
java.lang.Object
org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer
Helps with configuring options for asynchronous request processing.
- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected List<CallableProcessingInterceptor>protected List<DeferredResultProcessingInterceptor>protected AsyncTaskExecutorprotected LongregisterCallableInterceptors(CallableProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aCallable.registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aDeferredResult.setDefaultTimeout(long timeout) Specify the amount of time, in milliseconds, before asynchronous request handling times out.setTaskExecutor(AsyncTaskExecutor taskExecutor) The provided task executor is used for the following: HandleCallablecontroller method return values.
- 
Constructor Details- 
AsyncSupportConfigurerpublic AsyncSupportConfigurer()
 
- 
- 
Method Details- 
setTaskExecutorThe provided task executor is used for the following:- Handle Callablecontroller method return values.
- Perform blocking writes when streaming to the response through a reactive (for example, Reactor, RxJava) controller method return value.
 If your application has controllers with such return types, please configure an AsyncTaskExecutoras the one used by default is not suitable for production under load.- Parameters:
- taskExecutor- the task executor instance to use by default
 
- Handle 
- 
setDefaultTimeoutSpecify the amount of time, in milliseconds, before asynchronous request handling times out. In Servlet 3, the timeout begins after the main request processing thread has exited and ends when the request is dispatched again for further processing of the concurrently produced result.If this value is not set, the default timeout of the underlying implementation is used. - Parameters:
- timeout- the timeout value in milliseconds
 
- 
registerCallableInterceptorspublic AsyncSupportConfigurer registerCallableInterceptors(CallableProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aCallable.- Parameters:
- interceptors- the interceptors to register
 
- 
registerDeferredResultInterceptorspublic AsyncSupportConfigurer registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aDeferredResult.- Parameters:
- interceptors- the interceptors to register
 
- 
getTaskExecutor
- 
getTimeout
- 
getCallableInterceptors
- 
getDeferredResultInterceptors
 
-