protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            configurator.UseDelayedRedelivery(r => r.Interval(1, TimeSpan.FromMilliseconds(100)));
            configurator.UseRetry(r => r.Interval(1, TimeSpan.FromMilliseconds(100)));
            configurator.UseInMemoryOutbox();

            configurator.Consumer <TestHandler>();
        }
Beispiel #2
0
        protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _consumer = new FailingBatchConsumer();

            configurator.UseDelayedRedelivery(r => r.Intervals(100));
            configurator.UseMessageRetry(r => r.Immediate(1));

            configurator.Consumer(() => _consumer);

            configurator.Handler <Fault <PingMessage> >(async m =>
            {
                if (_firstId == m.Message.Message.CorrelationId)
                {
                    _firstFault.SetResult(m);
                }
                if (_secondId == m.Message.Message.CorrelationId)
                {
                    _secondFault.SetResult(m);
                }
            });
        }
        protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _count    = 0;
            _received = new[]
            {
                GetTask <ConsumeContext <PingMessage> >(),
                GetTask <ConsumeContext <PingMessage> >(),
                GetTask <ConsumeContext <PingMessage> >(),
                GetTask <ConsumeContext <PingMessage> >()
            };
            _timestamps = new DateTime[4];

            configurator.UseDelayedRedelivery(r => r.Intervals(1000, 2000, 3000));

            configurator.Handler <PingMessage>(async context =>
            {
                _received[_count].TrySetResult(context);
                _timestamps[_count] = DateTime.Now;

                _count++;

                throw new IntentionalTestException("I'm so not ready for this jelly.");
            });
        }