Class RetryLogger

  • All Implemented Interfaces:
    org.springframework.retry.RetryListener

    @Component
    public class RetryLogger
    extends org.springframework.retry.listener.RetryListenerSupport
    Provide logging when an operation has failed and is being retried. This would not be needed if there was better logging control over the default RetryContext.
    Author:
    paul
    • Constructor Detail

      • RetryLogger

        public RetryLogger()
    • Method Detail

      • close

        public <T> void close​(org.springframework.retry.RetryContext context,
                              org.springframework.retry.RetryCallback<T> callback,
                              @Nullable
                              Throwable throwable)
        Specified by:
        close in interface org.springframework.retry.RetryListener
        Overrides:
        close in class org.springframework.retry.listener.RetryListenerSupport
      • onError

        public <T> void onError​(org.springframework.retry.RetryContext context,
                                org.springframework.retry.RetryCallback<T> callback,
                                Throwable throwable)
        Specified by:
        onError in interface org.springframework.retry.RetryListener
        Overrides:
        onError in class org.springframework.retry.listener.RetryListenerSupport