The interface AsyncConfigurer can be implemented by @Configuration classes to customize the Executor instance or handling exception thrown in async method by using AsyncUncaughtExceptionHandler
Example
Using @Async
package com.logicbig.example;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
@Component
public class MyBean {
@Async
public void runTask() {
System.out.printf("Running task thread: %s%n",
Thread.currentThread().getName());
throw new RuntimeException("test exception");
}
}