We are migrating a Spring Boot 2 + Sleuth/Zipkin app to Spring Boot 3 + Micrometer/Zipkin.
import java.util.concurrent.ExecutorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.instrument.async.TraceableExecutorService;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class ConnectorService implements Connector {
protected final BankService bankService;
protected final ExecutorService executorService;
@Autowired
public ConnectorService(BankService bankService, BeanFactory beanFactory) {
this.bankService = bankService;
this.executorService = new TraceableExecutorService(beanFactory, new ContextAwareThreadPoolExecutor());
}
@Override
public void notifyOnPaymentStatusChange(Payment payment) {
executorService.execute(() -> {
try {
bankService.notifyOnPaymentStatusChange(payment);
} catch (RuntimeException e) {
log.error("Error message goes here" + e);
}
});
}
}
Is there an equivalent mechanism provided by Spring Boot 3 to replace org.springframework.cloud.sleuth.instrument.async.TraceableExecutorService?