Hystrix icon indicating copy to clipboard operation
Hystrix copied to clipboard

hsytrixTimer.addTimeListener,the method submit a scheduled runnable is not use hystrix concurrent strategy

Open fengyapeng opened this issue 6 years ago • 0 comments

`

 public Reference<TimerListener> addTimerListener(final TimerListener listener) {
  
  startThreadIfNeeded();

    // add the listener
    Runnable r = new Runnable() {
        @Override
        public void run() {
            try {
                listener.tick();
            } catch (Exception e) {
                logger.error("Failed while ticking TimerListener", e);
            }
        }
    };

    ScheduledFuture<?> f = executor.get().getThreadPool().scheduleAtFixedRate(r, listener.getIntervalTimeInMilliseconds(), listener.getIntervalTimeInMilliseconds(), TimeUnit.MILLISECONDS);
    return new TimerReference(listener, f);
}

`

the Runnable not belong to HystrixContextRunnable's instance . So, I cant to add something like "MDC of slf4j" for tracing event notify.

fengyapeng avatar Dec 09 '19 07:12 fengyapeng