Author: tabish Date: Wed Aug 12 23:09:24 2015 New Revision: 1695621 URL: http://svn.apache.org/r1695621 Log: https://issues.apache.org/jira/browse/AMQNET-508 https://issues.apache.org/jira/browse/AMQNET-507
Ensure that a pull command is sent on expire, also ensure that the tinout is not updated if set to -1 to indicate broker side timeout. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=1695621&r1=1695620&r2=1695621&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Wed Aug 12 23:09:24 2015 @@ -1058,6 +1058,8 @@ namespace Apache.NMS.ActiveMQ timeout = deadline - dispatchTime; } } + + SendPullRequest((long) timeout.TotalMilliseconds); } else if (RedeliveryExceeded(dispatch)) { @@ -1069,15 +1071,18 @@ namespace Apache.NMS.ActiveMQ // Refresh the dispatch time dispatchTime = DateTime.Now; - if(dispatchTime > deadline) - { - // Out of time. - timeout = TimeSpan.Zero; - } - else + if(timeout > TimeSpan.Zero && !this.unconsumedMessages.Closed) { - // Adjust the timeout to the remaining time. - timeout = deadline - dispatchTime; + if(dispatchTime > deadline) + { + // Out of time. + timeout = TimeSpan.Zero; + } + else + { + // Adjust the timeout to the remaining time. + timeout = deadline - dispatchTime; + } } SendPullRequest((long) timeout.TotalMilliseconds);