``` @Configuration @EnableAsync class AsynchConfig...
# spring
m
Copy code
@Configuration
@EnableAsync
class AsynchConfig : AsyncConfigurerSupport() {

    override fun getAsyncExecutor(): Executor {
        val executor = ThreadPoolTaskExecutor()
        executor.setTaskDecorator(MDCTaskDecorator())
        executor.initialize()
        return executor
    }
}
j
Are you using Spring Boot?
m
Yes I'm using Spring Boot
j
Ok, I was suspecting that you are getting two instances of Executor, one created by Spring config (AsyncConfigurerSupport) and one Spring Boot auto-config (maybe TaskExecutionAutoConfiguration), but I'm not sure if this is possible.
for Async we just set up Exectutor by
Copy code
@Bean
    fun taskExecutor(): Executor { return TaskExecutorBuilder()... }
(Kotlin)