There is an application that run some process by scheduler, like we have multiple instances we choose shedlock to block other run the same process. However, is not working since sleuth provides an instances of Runnable which is TraceRunnable and the expected is ScheduledMethodRunnable. Any ideas to solve this?
class SpringLockConfigurationExtractor
@Override
public Optional<LockConfiguration> getLockConfiguration(Runnable task) {
if (task instanceof ScheduledMethodRunnable) {
ScheduledMethodRunnable scheduledMethodRunnable = (ScheduledMethodRunnable) task;
return getLockConfiguration(scheduledMethodRunnable.getTarget(), scheduledMethodRunnable.getMethod());
} else {
logger.debug("Unknown task type " + task);
}
return Optional.empty();
}