@Override public void configureAsyncSupport(final AsyncSupportConfigurer configurer) { final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(2); executor.setMaxPoolSize(2); executor.setQueueCapacity(DOWNLOAD_QUEUE_SIZE); executor.setThreadNamePrefix("AsyncTaskExecutor-"); executor.initialize(); configurer.setTaskExecutor(executor); }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { // initial timeout configurer.setDefaultTimeout(6000); configurer.registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() { @Override public <T> boolean handleTimeout(NativeWebRequest req, DeferredResult<T> result) { return result.setErrorResult(new DiscoveryAsyncTimeoutException()); } }); }
@Override public void configureAsyncSupport(final AsyncSupportConfigurer configurer) { configurer.registerDeferredResultInterceptors( new DeferredResultProcessingInterceptorAdapter() { @Override public <T> boolean handleTimeout(final NativeWebRequest request, final DeferredResult<T> result) { log.error("timeout request..."); result.setErrorResult(new RuntimeException()); return false; } }); }
@Bean public WebMvcConfigurerAdapter webMvcConfigurerAdapter(AsyncTaskExecutor asyncTaskExecutor) { return new WebMvcConfigurerAdapter() { @Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.setTaskExecutor(asyncTaskExecutor); super.configureAsyncSupport(configurer); } }; }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { Long timeout = this.mvcProperties.getAsync().getRequestTimeout(); if (timeout != null) { configurer.setDefaultTimeout(timeout); } }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer){ if(asyncTaskExecutor!=null){ configurer.setTaskExecutor(asyncTaskExecutor); } if(mvcAsyncProperties!=null){ configurer.setDefaultTimeout(mvcAsyncProperties.getTimeout()); } }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { if (asyncRequestTimeout != null) { configurer.setDefaultTimeout(asyncRequestTimeout); } }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.registerCallableInterceptors(callableInterceptor()); }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.setDefaultTimeout(-1); configurer.setTaskExecutor(asyncTaskExecutor()); }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.registerDeferredResultInterceptors(new ReadListenerDeferredResultProcessingInterceptor()); }
@Override public void configureAsyncSupport(final AsyncSupportConfigurer configurer) { configurer.setDefaultTimeout(nakadiStreamTimeout); configurer.registerCallableInterceptors(timeoutInterceptor()); }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.setTaskExecutor(getAsyncExecutor()); }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.setTaskExecutor(new SimpleAsyncTaskExecutor()); }