Exemplo n.º 1
0
		protected virtual int AppendException(BasicDeliverEventArgs message, Exception exception)
		{
			if (exception == null)
				return 0;

			var currentAttempt = message.GetAttemptCount();
			message.SetAttemptCount(currentAttempt + 1); // 1-based value

			this.adapter.AppendException(message, exception, currentAttempt);

			return currentAttempt;
		}
Exemplo n.º 2
0
		protected virtual void RetryMessage(BasicDeliverEventArgs message, Exception exception)
		{
			var nextAttempt = message.GetAttemptCount() + 1;
			message.SetAttemptCount(nextAttempt);

			// 0-based to 1-based value
			Log.Debug("Message '{0}' has been attempted {1} times.", message.MessageId(), nextAttempt);

			if (nextAttempt > this.configuration.MaxAttempts)
				this.ForwardToPoisonMessageExchange(message, exception);
			else
				this.ForwardTo(message, this.configuration.InputQueue.ToPublicationAddress());
		}