Пример #1
0
 public IGrammar MessageAttempts()
 {
     return(this[nameof(MessageAttempt)]
            .AsTable("If the message processing is")
            .Before(c => _message = new ErrorCausingMessage())
            .After(async c => await _bus.Send(_message)));
 }
Пример #2
0
        public void Handle(ErrorCausingMessage message, Envelope envelope, AttemptTracker tracker)
        {
            tracker.LastAttempt = envelope.Attempts;

            if (!message.Errors.ContainsKey(envelope.Attempts))
            {
                message.WasProcessed = true;

                return;
            }

            var type = GetExceptionType(message.Errors[envelope.Attempts]);
            var ex   = Activator.CreateInstance(type).As <Exception>();

            throw ex;
        }
Пример #3
0
 public async Task SendMessageWithNoErrors()
 {
     _message = new ErrorCausingMessage();
     await _bus.Send(_message);
 }
Пример #4
0
 public void SendMessageWithNoErrors()
 {
     _message = new ErrorCausingMessage();
     _bus.Send(_message);
 }