/// <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;
        }
Exemplo n.º 3
0
 public MessageAvailable(IncomingTransportMessage transportMessage)
 {
     this.TransportMessage = transportMessage;
 }
Exemplo n.º 4
0
 public MessageAvailable(IncomingTransportMessage transportMessage)
 {
     this.TransportMessage = transportMessage;
 }