@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; } }); }
@Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.setDefaultTimeout(2500).setTaskExecutor(new ConcurrentTaskExecutor()) .registerCallableInterceptors(new CallableProcessingInterceptorAdapter() { }) .registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {}); }