Şu satırı dahil ederiz
import org.springframework.retry.listener.RetryListenerSupport;
Kullanım
Örnek
Şöyle yaparız
@Bean public RetryTemplate installTemplate() { RetryTemplate retryTemplate = new RetryTemplate(); retryTemplate.registerListener(new MyRetryListener()); return retryTemplate; }
Örnek
Şöyle yaparız
public class MyRetryListener extends RetryListenerSupport { @Override public <T, E extends Throwable> void onError(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) { Metrics.addMetric("mysql_connection_error",1); super.onError(context,callback,throwable); } ... }
Hiç yorum yok:
Yorum Gönder