Class LoadBalancedRecoveryCallback<T,​R>

  • Type Parameters:
    T - - response type to return
    R - - response type from the HTTP client
    All Implemented Interfaces:
    org.springframework.retry.RecoveryCallback<T>

    public abstract class LoadBalancedRecoveryCallback<T,​R>
    extends Object
    implements org.springframework.retry.RecoveryCallback<T>
    An implementation of RecoveryCallback which relies on an implementation of RetryableStatusCodeException to contain the last response object from the request.
    Author:
    LiYuan Lee
    • Constructor Detail

      • LoadBalancedRecoveryCallback

        public LoadBalancedRecoveryCallback()
    • Method Detail

      • createResponse

        protected abstract T createResponse​(R response,
                                            URI uri)
        Creates the response returned in the RecoveryCallback.
        Parameters:
        response - The response from the HTTP client.
        uri - The URI the response is from.
        Returns:
        The response to be returned.
      • recover

        public T recover​(org.springframework.retry.RetryContext context)
                  throws Exception
        Specified by:
        recover in interface org.springframework.retry.RecoveryCallback<T>
        Throws:
        Exception