Skip to content
Permalink
Browse files
  • Loading branch information
Timothy A. Bish committed Jan 26, 2011
1 parent 9108580 commit cc28c5b15a4d6d642b47f35a3556799a7d0bffb3
Showing 2 changed files with 16 additions and 2 deletions.
@@ -55,8 +55,8 @@ public class MessageConsumer : IMessageConsumer, IDispatcher
private bool inProgressClearRequiredFlag;

private event MessageListener listener;

private IRedeliveryPolicy redeliveryPolicy;
private Exception failureError;

// Constructor internal to prevent clients from creating an instance.
internal MessageConsumer(Session session, ConsumerInfo info)
@@ -534,7 +534,14 @@ private MessageDispatch Dequeue(TimeSpan timeout)
}
else
{
return null;
if(this.failureError != null)
{
throw NMSExceptionSupport.Create(FailureError);
}
else
{
return null;
}
}
}
else if(dispatch.Message == null)
@@ -882,6 +889,12 @@ private void CheckMessageListener()
}
}

public Exception FailureError
{
get { return this.failureError; }
set { this.failureError = value; }
}

#region Nested ISyncronization Types

class MessageConsumerSynchronization : ISynchronization
@@ -303,6 +303,7 @@ internal void DoClose()
{
foreach(MessageConsumer consumer in consumers.Values)
{
consumer.FailureError = this.connection.FirstFailureError;
consumer.DoClose();
}
}

0 comments on commit cc28c5b

Please sign in to comment.