/// <summary> /// Initializes the error context. /// </summary> public ErrorContext(Exception exception, Dictionary <string, string> headers, string transportMessageId, byte[] body, TransportTransaction transportTransaction, int immediateProcessingFailures) { Exception = exception; TransportTransaction = transportTransaction; ImmediateProcessingFailures = immediateProcessingFailures; Message = new IncomingMessage(transportMessageId, headers, body); DelayedDeliveriesPerformed = Message.GetDelayedDeliveriesPerformed(); }
/// <summary> /// Initializes the error context. /// </summary> public ErrorContext(Exception exception, Dictionary<string, string> headers, string transportMessageId, byte[] body, TransportTransaction transportTransaction, int immediateProcessingFailures) { Exception = exception; TransportTransaction = transportTransaction; ImmediateProcessingFailures = immediateProcessingFailures; Message = new IncomingMessage(transportMessageId, headers, body); DelayedDeliveriesPerformed = Message.GetDelayedDeliveriesPerformed(); }
/// <summary> /// Initializes the error context. /// </summary> /// <param name="exception">The exception that caused the message processing failure.</param> /// <param name="headers">The message headers.</param> /// <param name="nativeMessageId">The native message ID.</param> /// <param name="body">The message body.</param> /// <param name="transportTransaction">Transaction (along with connection if applicable) used to receive the message.</param> /// <param name="immediateProcessingFailures">Number of failed immediate processing attempts.</param> /// <param name="context">A <see cref="ContextBag" /> which can be used to extend the current object.</param> public ErrorContext(Exception exception, Dictionary <string, string> headers, string nativeMessageId, byte[] body, TransportTransaction transportTransaction, int immediateProcessingFailures, ContextBag context) { Guard.AgainstNull(nameof(exception), exception); Guard.AgainstNull(nameof(transportTransaction), transportTransaction); Guard.AgainstNegative(nameof(immediateProcessingFailures), immediateProcessingFailures); Guard.AgainstNull(nameof(context), context); Exception = exception; TransportTransaction = transportTransaction; ImmediateProcessingFailures = immediateProcessingFailures; Message = new IncomingMessage(nativeMessageId, headers, body); DelayedDeliveriesPerformed = Message.GetDelayedDeliveriesPerformed(); Extensions = context; }