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(this IPipeConfigurator <ConsumeContext> configurator, Action <IRetryConfigurator> configure)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var specification = new ConsumeContextRetryPipeSpecification();

            configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
        public static void UseRetry <T>(this IPipeConfigurator <ConsumeContext <T> > configurator, Action <IRetryConfigurator> configure)
            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));

            configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
Ejemplo n.º 4
0
        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> >(Factory);

            specification.SetRetryPolicy(x => retryPolicy);

            configurator.AddPipeSpecification(specification);
        }
Ejemplo n.º 5
0
        public static void UseRetry <TSaga>(this IPipeConfigurator <SagaConsumeContext <TSaga> > configurator, Action <IRetryConfigurator> configure)
            where TSaga : class, ISaga
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

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

            configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
        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> >((x, r) => new RetrySagaConsumeContext <TSaga>(x, r));

            specification.SetRetryPolicy(x => retryPolicy);

            configurator.AddPipeSpecification(specification);
        }
Ejemplo n.º 7
0
        public static void UseRetry(this IBusFactoryConfigurator configurator, Action <IRetryConfigurator> configure)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var observer = new RetryBusObserver();

            configurator.ConnectBusObserver(observer);

            var specification = new ConsumeContextRetryPipeSpecification(observer.Stopping);

            configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
Ejemplo n.º 8
0
        public static void UseRetry <TSaga>(this IPipeConfigurator <SagaConsumeContext <TSaga> > configurator, IBusFactoryConfigurator connector, Action <IRetryConfigurator> configure)
            where TSaga : class, ISaga
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var observer = new RetryBusObserver();

            connector.ConnectBusObserver(observer);

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

            configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }