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); }
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(); }
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(); }
public void SetUp() { envelope.Message = new Message1(); report = new ErrorReport(envelope, exception); }
// 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 }); }
protected bool Equals(ErrorReport other) { return Equals(Message, other.Message) && string.Equals(ExceptionText, other.ExceptionText); }