Class CancellationReason

  • public class CancellationReason
    extends Object
    Describes the reason why a Request has been cancelled.
    • Field Detail


        public static final CancellationReason STOPPED_LISTENING
        The downstream consumer stopped listening for a result and therefore any further processing is a waste of resources.
      • TIMEOUT

        public static final CancellationReason TIMEOUT
        The request ran into a timeout and is therefore cancelled before it got a chance to complete.

        public static final CancellationReason CANCELLED_VIA_CONTEXT
        The user or some other code proactively cancelled the request by cancelling it through its attached context.
      • SHUTDOWN

        public static final CancellationReason SHUTDOWN
        The SDK has been shut down already when this request is dispatched.
      • OTHER

        public static final CancellationReason OTHER
        For a different reason. Make sure to emit an event so that debugging provides further context.

        public static final CancellationReason TOO_MANY_REQUESTS_IN_RETRY
        If too many outstanding requests are waiting to be completed. This is the SDK backpressure signal.

        public static final CancellationReason TARGET_NODE_REMOVED
        When a TargetedRequest is dispatched but the list of nodes does not contain the target at all, there is good chance that this request will not be able to make progress anymore so it will be cancelled.

        Request creators are advised to grab a fresh config, a new target, and re-dispatch the operation to give it a chance to make progress eventually.

    • Method Detail

      • noMoreRetries

        public static CancellationReason noMoreRetries​(RetryReason retryReason)
        This cancellation reason indicates that no more retries were allowed based on the retry strategy.
        retryReason - the retry reason why it got sent into retry.
        the cancellation reason instance.
      • innerReason

        public Object innerReason()
        If applicable, returns an inner reason for the cancellation for additional context.
      • identifier

        public String identifier()
        Returns the identifier for this reason.
      • hashCode

        public int hashCode()
        hashCode in class Object