Inidicates recoverability is required to delay retry the current message.
Inheritance: RecoverabilityAction
Esempio n. 1
0
        async Task <ErrorHandleResult> DeferMessage(DelayedRetry action, ErrorContext errorContext)
        {
            var message = errorContext.Message;

            Logger.Warn($"Delayed Retry will reschedule message '{message.MessageId}' after a delay of {action.Delay} because of an exception:", errorContext.Exception);

            var currentDelayedRetriesAttempts = await delayedRetryExecutor.Retry(message, action.Delay, errorContext.TransportTransaction).ConfigureAwait(false);

            if (raiseNotifications)
            {
                await eventAggregator.Raise(new MessageToBeRetried(currentDelayedRetriesAttempts, action.Delay, message, errorContext.Exception)).ConfigureAwait(false);
            }
            return(ErrorHandleResult.Handled);
        }
Esempio n. 2
0
        async Task <ErrorHandleResult> DeferMessage(DelayedRetry action, ErrorContext errorContext, CancellationToken cancellationToken)
        {
            var message = errorContext.Message;

            Logger.Warn($"Delayed Retry will reschedule message '{message.MessageId}' after a delay of {action.Delay} because of an exception:", errorContext.Exception);

            var currentDelayedRetriesAttempts = await delayedRetryExecutor.Retry(message, action.Delay, errorContext.TransportTransaction, cancellationToken).ConfigureAwait(false);

            if (raiseNotifications)
            {
                await messageRetryNotification.Raise(
                    new MessageToBeRetried(
                        attempt : currentDelayedRetriesAttempts,
                        delay : action.Delay,
                        immediateRetry : false,
                        errorContext : errorContext),
                    cancellationToken)
                .ConfigureAwait(false);
            }

            return(ErrorHandleResult.Handled);
        }
        async Task<ErrorHandleResult> DeferMessage(DelayedRetry action, ErrorContext errorContext)
        {
            var message = errorContext.Message;

            Logger.Warn($"Delayed Retry will reschedule message '{message.MessageId}' after a delay of {action.Delay} because of an exception:", errorContext.Exception);

            var currentDelayedRetriesAttempts = await delayedRetryExecutor.Retry(message, action.Delay, errorContext.TransportTransaction).ConfigureAwait(false);

            if (raiseNotifications)
            {
                await eventAggregator.Raise(
                    new MessageToBeRetried(
                        attempt: currentDelayedRetriesAttempts,
                        delay: action.Delay,
                        immediateRetry: false,
                        errorContext: errorContext))
                    .ConfigureAwait(false);
            }
            return ErrorHandleResult.Handled;
        }