public static void UseRetry(this IPipeConfigurator <ConsumeContext> configurator, IRetryPolicy retryPolicy)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var specification = new ConsumeContextRetryPipeSpecification();

            specification.SetRetryPolicy(x => retryPolicy);

            configurator.AddPipeSpecification(specification);
        }
        public static void UseRetry <T>(this IPipeConfigurator <ConsumeContext <T> > configurator, IRetryPolicy retryPolicy)
            where T : class
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var specification = new ConsumeContextRetryPipeSpecification <ConsumeContext <T>, RetryConsumeContext <T> >((x, r) => new RetryConsumeContext <T>(x, r));

            specification.SetRetryPolicy(x => retryPolicy);

            configurator.AddPipeSpecification(specification);
        }
示例#3
0
        public static void UseRetry <TSaga>(this IPipeConfigurator <SagaConsumeContext <TSaga> > configurator, IRetryPolicy retryPolicy)
            where TSaga : class, ISaga
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var specification = new ConsumeContextRetryPipeSpecification <SagaConsumeContext <TSaga>, RetrySagaConsumeContext <TSaga> >(Factory);

            specification.SetRetryPolicy(x => retryPolicy);

            configurator.AddPipeSpecification(specification);
        }