Пример #1
0
        void IConsumerConfigurationObserver.ConsumerMessageConfigured <T, TMessage>(IConsumerMessageConfigurator <T, TMessage> configurator)
        {
            var specification = new ConsumeContextRetryPipeSpecification <ConsumeContext <TMessage>, RetryConsumeContext <TMessage> >(Factory, _cancellationToken);

            _configure?.Invoke(specification);

            _configurator.Message <TMessage>(x => x.AddPipeSpecification(specification));
        }
Пример #2
0
        void IHandlerConfigurationObserver.HandlerConfigured <T>(IHandlerConfigurator <T> configurator)
        {
            var specification = new ConsumeContextRetryPipeSpecification <ConsumeContext <T>, RetryConsumeContext <T> >(Factory, _cancellationToken);

            _configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
        public void MessageConfigured <TMessage>(IConsumePipeConfigurator configurator)
            where TMessage : class
        {
            var specification = new ConsumeContextRetryPipeSpecification <ConsumeContext <TMessage>, RetryConsumeContext <TMessage> >(Factory, _cancellationToken);

            _configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
Пример #4
0
        public void MessageConfigured <TMessage>(IConsumePipeConfigurator configurator)
            where TMessage : class
        {
            var specification =
                new ConsumeContextRetryPipeSpecification <ConsumeContext <TMessage>, RetryConsumeContext <TMessage> >((x, r) => new RetryConsumeContext <TMessage>(x, r));

            _configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
        public override void BatchConsumerConfigured <TConsumer, TMessage>(IConsumerMessageConfigurator <TConsumer, Batch <TMessage> > configurator)
        {
            var consumerSpecification = configurator as IConsumerMessageSpecification <TConsumer, Batch <TMessage> >;

            if (consumerSpecification == null)
            {
                throw new ArgumentException("The configurator must be a consumer specification");
            }

            var specification = new ConsumeContextRetryPipeSpecification <ConsumeContext <Batch <TMessage> >, RetryConsumeContext <Batch <TMessage> > >(Factory,
                                                                                                                                                        _cancellationToken);

            _configure?.Invoke(specification);

            consumerSpecification.AddPipeSpecification(specification);
        }
Пример #6
0
        void IConsumerConfigurationObserver.ConsumerMessageConfigured <TConsumer, TMessage>(IConsumerMessageConfigurator <TConsumer, TMessage> configurator)
        {
            Tuple <Type, Type> key = Tuple.Create(typeof(TConsumer), typeof(TMessage));

            if (_messageTypes.Contains(key))
            {
                return;
            }

            _messageTypes.Add(key);

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

            _configure?.Invoke(specification);

            _configurator.AddPipeSpecification(specification);
        }