Spring Boot: how to set Async timeout when deploying to an external server
<p>While using the embedded tomcat for deploying my spring boot app, I set the async timeout as follows:</p>

<pre><code>@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {

        @Override
        public void customize(Connector connector) {
            connector.setAsyncTimeout(60000);
        }
    });
    return factory;
}
</code></pre>

<p>But,how to achieve the same when deploying to an external server, for example, websphere?</p>

<p>Tried using the property:</p>

<p>spring.mvc.async.request-timeout=600000</p>

<p>But this did not have any effect.</p>

<p><strong>Edit:</strong></p>

<p>I had tried implementing AsyncConfigurer as per Andrei's suggestion. But it did not work as expected. Below is my configuration class:</p>

<pre><code>@SpringBootApplication
@EnableAsync
 public class Application implements AsyncConfigurer {

public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
}

@Override
public Executor getAsyncExecutor() {
    Executor executor = new ThreadPoolExecutor(10, 20, 60, TimeUnit.SECONDS, new ArrayBlockingQueue&lt;&gt;(10),
            new ThreadPoolExecutor.AbortPolicy());
    return executor;
}

@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
    // TODO Auto-generated method stub
    return new SimpleAsyncUncaughtExceptionHandler();
}
 }
</code></pre>

<p>I have given timeout as 60 seconds, but when trying this configuration, the request was timing out after 30 seconds. Was using RestClient. </p>

<p>Is there something I am missing?</p>