I am migrating my project from Spring boot version 2.7.4 to version 3.2.2. i need to use micrometer instead of sleuth how should I edit the "Executor" BEAN I mentioned below for asynchronous?
What should I use instead of LazyTraceExecutor class?
@Bean("asyncExecutor")
public Executor getAsyncExecutor(BeanFactory beanFactory) {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setThreadNamePrefix("Async-");
executor.setTaskDecorator(new ContextDecorator());
executor.initialize();
return new LazyTraceExecutor(beanFactory, executor);
}
You don't need a substitution for LazyTraceExecutor.
The following should work fine: