예제 #1
0
        public void Execute(Envelope envelope, IEnvelopeContext context)
        {
            context.SendFailureAcknowledgement(envelope, "Moved message {0} to the Error Queue.\n{1}".ToFormat(envelope.CorrelationId, _exception));

            var report = new ErrorReport(envelope, _exception);
            envelope.Callback.MoveToErrors(report);
        }
예제 #2
0
        public void MoveToErrors(ErrorReport report)
        {
            var messagePayload = new MessagePayload
            {
                Data = report.Serialize(),
                Headers = report.Headers
            };

            messagePayload.Headers.Add("ExceptionType", report.ExceptionType);

            _transaction.EnqueueDirectlyTo(LightningQueuesTransport.ErrorQueueName, messagePayload, _message.Id);
            MarkSuccessful();
        }
예제 #3
0
        public void MoveToErrors(ErrorReport report)
        {
            var message = new Message
            {
                Id = _message.Id,
                Data = report.Serialize(),
                //Headers = report.Headers
            };

            message.Headers.Add("ExceptionType", report.ExceptionType);
            message.Queue = LightningQueuesTransport.ErrorQueueName;

            _context.Enqueue(message);
            MarkSuccessful();
        }
예제 #4
0
 public void SetUp()
 {
     envelope.Message = new Message1();
     report = new ErrorReport(envelope, exception);
 }
예제 #5
0
 // TODO -- make it fancier later and copy envelope headers
 public void MoveToErrors(ErrorReport report)
 {
     var uri = (_parent.Uri.ToString() + "errors").ToUri();
     InMemoryQueueManager.QueueFor(uri).Enqueue(new EnvelopeToken
     {
         Message = report
     });
 }
예제 #6
0
 protected bool Equals(ErrorReport other)
 {
     return Equals(Message, other.Message) && string.Equals(ExceptionText, other.ExceptionText);
 }