/// <summary>
        /// Returns true if the max number of retries for the message have been exceeded. Also sets the last Exception
        /// raised. Otherwise returns false.
        /// </summary>
        public bool MaxRetriesExceeded(IncomingTransportMessage message, out Exception lastException)
        {
            string messageId = message.MessageId;

            failuresPerMessageLocker.EnterReadLock();

            if (failuresPerMessage.ContainsKey(messageId) &&
                (failuresPerMessage[messageId] >= maxRetries))
            {
                failuresPerMessageLocker.ExitReadLock();
                failuresPerMessageLocker.EnterWriteLock();

                lastException = exceptionsForMessages[messageId];
                failuresPerMessage.Remove(messageId);
                exceptionsForMessages.Remove(messageId);

                failuresPerMessageLocker.ExitWriteLock();

                return(true);
            }

            lastException = null;
            failuresPerMessageLocker.ExitReadLock();
            return(false);
        }
        /// <summary>
        /// Returns true if the max number of retries for the message have been exceeded. Also sets the last Exception
        /// raised. Otherwise returns false.
        /// </summary>
        public bool MaxRetriesExceeded(IncomingTransportMessage message, out Exception lastException)
        {
            string messageId = message.MessageId;
            failuresPerMessageLocker.EnterReadLock();

            if (failuresPerMessage.ContainsKey(messageId) &&
                (failuresPerMessage[messageId] >= maxRetries))
            {
                failuresPerMessageLocker.ExitReadLock();
                failuresPerMessageLocker.EnterWriteLock();

                lastException = exceptionsForMessages[messageId];
                failuresPerMessage.Remove(messageId);
                exceptionsForMessages.Remove(messageId);

                failuresPerMessageLocker.ExitWriteLock();

                return true;
            }

            lastException = null;
            failuresPerMessageLocker.ExitReadLock();
            return false;
        }
Beispiel #3
0
 public MessageAvailable(IncomingTransportMessage transportMessage)
 {
     this.TransportMessage = transportMessage;
 }
Beispiel #4
0
 public MessageAvailable(IncomingTransportMessage transportMessage)
 {
     this.TransportMessage = transportMessage;
 }