Пример #1
0
            protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator <DiscoveryPingState> sagaConfigurator)
            {
                var partition = endpointConfigurator.CreatePartitioner(Environment.ProcessorCount);

                sagaConfigurator.Message <PingReceived>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
                sagaConfigurator.Message <PingAcknowledged>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
            }
Пример #2
0
        protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator <PatronState> sagaConfigurator)
        {
            sagaConfigurator.Message <PatronEntered>(x => x.UsePartitioner(_partition, m => m.Message.PatronId));
            sagaConfigurator.Message <PatronLeft>(x => x.UsePartitioner(_partition, m => m.Message.PatronId));

            endpointConfigurator.UseMessageRetry(r => r.Intervals(20, 50, 100, 1000, 5000));
        }
Пример #3
0
        protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator <AccountTransferStateInstance> sagaConfigurator)
        {
            var partition = endpointConfigurator.CreatePartitioner(Environment.ProcessorCount);

            sagaConfigurator.Message <TransferStarted>(x => x.UsePartitioner(partition, m => m.Message.Id));
            sagaConfigurator.Message <TransferOutAmountCompleted>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
            sagaConfigurator.Message <TransferInAmountCompleted>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
        }
Пример #4
0
        protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator <SmsState> sagaConfigurator)
        {
            var partition = endpointConfigurator.CreatePartitioner(16);

            sagaConfigurator.Message <SmsSubmit>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
            sagaConfigurator.Message <SmsAccepted>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
            // sagaConfigurator.Message<OrderCanceled>(x => x.UsePartitioner(partition, m => m.Message.CorrelationId));
            sagaConfigurator.UseInMemoryOutbox();
        }
        protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator <BatchState> sagaConfigurator)
        {
            sagaConfigurator.UseMessageRetry(r => r.Immediate(5));
            sagaConfigurator.UseInMemoryOutbox();

            var partition = endpointConfigurator.CreatePartitioner(8);

            sagaConfigurator.Message <BatchJobDone>(x => x.UsePartitioner(partition, m => m.Message.BatchId));
            sagaConfigurator.Message <BatchReceived>(x => x.UsePartitioner(partition, m => m.Message.BatchId));
            sagaConfigurator.Message <CancelBatch>(x => x.UsePartitioner(partition, m => m.Message.BatchId));
        }
Пример #6
0
        void ISagaConfigurationObserver.SagaMessageConfigured <T, TMessage>(ISagaMessageConfigurator <T, TMessage> configurator)
        {
            var specification = new TimeoutSpecification <TMessage>();

            _configure?.Invoke(specification);

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

            _configure?.Invoke(specification);

            _configurator.Message <TMessage>(x => x.AddPipeSpecification(specification));
        }
        void ISagaConfigurationObserver.SagaMessageConfigured <T, TMessage>(ISagaMessageConfigurator <T, TMessage> configurator)
        {
            var redeliverySpecification = new ScheduledRedeliveryPipeSpecification <TMessage>();
            var retrySpecification      = new RedeliveryRetryPipeSpecification <TMessage>();

            _configure?.Invoke(retrySpecification);

            _configurator.Message <TMessage>(x =>
            {
                x.AddPipeSpecification(redeliverySpecification);
                x.AddPipeSpecification(retrySpecification);
            });
        }
Пример #9
0
        void ISagaConfigurationObserver.SagaMessageConfigured <T, TMessage>(ISagaMessageConfigurator <T, TMessage> configurator)
        {
            var specification = new ConcurrencyLimitConsumePipeSpecification <TMessage>(_limiter);

            _configurator.Message <TMessage>(x => x.AddPipeSpecification(specification));
        }
Пример #10
0
        void ISagaConfigurationObserver.SagaMessageConfigured <T, TMessage>(ISagaMessageConfigurator <T, TMessage> configurator)
        {
            var specification = new InMemoryOutboxSpecification <TMessage>();

            _configurator.Message <TMessage>(x => x.AddPipeSpecification(specification));
        }