title: Spring-Boot Async Restcall Timeout Handling
body: <p>I need help again, when I got that project with spring-xml it worked, but I don't know how I can register a CallableProcessingInterceptor, so that it throws an exception after timeout.</p>
  
  <p>I am using Spring-Boot 1.10, One Client-Application calls RestApplication. When Response Of RestApplication takes too long, client throws timeout in background, but in browser nothing happend.</p>
  
  <p>I got a class called <code>TimeoutCallableProcessingInterceptor</code> already, what it worked before when using XML-Config. </p>
  
  <pre><code>public class TimeoutCallableProcessingInterceptor extends CallableProcessingInterceptorAdapter {
  
  @Override
  public &lt;T&gt; Object handleTimeout(final NativeWebRequest request, final Callable&lt;T&gt; task) throws Exception {
      throw new IllegalStateException("[" + task.getClass().getName() + "] timed out");
  }
  </code></pre>
  
  <p>}</p>
  
  <p>====</p>
  
  <p>WebMvcConfig</p>
  
  <pre><code>// Themeleaf and ApacheTiles Configs
  
  ...
  
  
  @Bean
  public TimeoutCallableProcessingInterceptor timeoutInterceptor() {
      return new TimeoutCallableProcessingInterceptor();
  }
  </code></pre>
  
  <p>How and where can I register that Interceptor using JAVACONFIG. </p>
  
  <p>If you need more information, please let me know. </p>
  
  <p>Thank you.</p>