Exemplo n.º 1
0
        public void Setup()
        {
            this.pipelineStepRaisingException = async() =>
            {
                await Task.Run(() => { throw new InvalidOperationException(); });
            };

            this.testTransportMessage = new TestTransportMessage(typeof(Message).AssemblyQualifiedName);
            var readOnlyConfiguration = new EndpointConfiguration.ReadOnly(new EndpointConfiguration().MaximumImmediateRetryCount(MaxImmediateRetryCount).MaximumDelayedRetryCount(MaxDelayedRetryCount));
            var logicalMessage        = new LogicalMessage(typeof(Message), new Message(), null);

            this.incomingLogicalContext = new IncomingLogicalContext(logicalMessage, this.testTransportMessage, readOnlyConfiguration);
            this.busMock = new Mock <IBusForHandler>();

            this.testee = new DelayMessagesWhenImmediateRetryCountIsReachedStep();
        }
        public void Setup()
        {
            try
            {
                throw new InvalidOperationException("Internal test exception");
            }
            catch (Exception exc)
            {
                this.internalException = exc;
            }

            this.pipelineStepRaisingException = async() =>
            {
                await Task.Run(() =>
                {
                    throw new InvalidOperationException();
                });
            };

            this.pipelineStepRaisingDeadletterMessageImmediatelyException = async() =>
            {
                await Task.Run(() =>
                {
                    throw new DeadletterMessageImmediatelyException(this.internalException);
                });
            };

            this.testTransportMessage = new TestTransportMessage(typeof(Message).AssemblyQualifiedName);
            var readOnlyConfiguration = new EndpointConfiguration.ReadOnly(new EndpointConfiguration().MaximumImmediateRetryCount(10).MaximumDelayedRetryCount(10));
            var logicalMessage        = new LogicalMessage(typeof(Message), new Message(), null);

            this.incomingLogicalContext = new IncomingLogicalContext(logicalMessage, this.testTransportMessage, readOnlyConfiguration);
            this.busMock = new Mock <IBusForHandler>();

            this.testee = new DeadletterMessageImmediatelyExceptionStep();
        }
Exemplo n.º 3
0
 public Task Invoke(IncomingLogicalContext context, IBusForHandler bus, Func <Task> next)
 {
     this.collector.Add(context.LogicalMessage);
     return(next());
 }
Exemplo n.º 4
0
 public Task Invoke(IncomingLogicalContext context, IBusForHandler bus, Func<Task> next)
 {
     this.collector.Add(context.LogicalMessage);
     return next();
 }