activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r830261 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp: Connection.cs MessageConsumer.cs
Date Tue, 27 Oct 2009 17:43:47 GMT
Author: tabish
Date: Tue Oct 27 17:43:46 2009
New Revision: 830261

URL: http://svn.apache.org/viewvc?rev=830261&view=rev
Log:
Fix some issues with Prefecth of zero found during testing.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=830261&r1=830260&r2=830261&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Tue Oct
27 17:43:46 2009
@@ -599,10 +599,15 @@
                 {
                     IDispatcher dispatcher = (IDispatcher) dispatchers[dispatch.ConsumerId];
 
-                    dispatch.Message.ReadOnlyBody = true;
-                    dispatch.Message.ReadOnlyProperties = true;
-                    dispatch.Message.RedeliveryCounter = dispatch.RedeliveryCounter;
-
+                    // Can be null when a consumer has sent a MessagePull and there was
+                    // no available message at the broker to dispatch.  
+                    if(dispatch.Message != null)
+                    {
+                        dispatch.Message.ReadOnlyBody = true;
+                        dispatch.Message.ReadOnlyProperties = true;
+                        dispatch.Message.RedeliveryCounter = dispatch.RedeliveryCounter;
+                    }
+                    
                     dispatcher.Dispatch(dispatch);
 
                     return;

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=830261&r1=830260&r2=830261&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
Tue Oct 27 17:43:46 2009
@@ -165,8 +165,17 @@
             CheckClosed();
             CheckMessageListener();
     
+            MessageDispatch dispatch = null;
             SendPullRequest((long)timeout.TotalMilliseconds);
-            MessageDispatch dispatch = this.Dequeue(timeout);
+            
+            if(this.PrefetchSize == 0)
+            {
+                dispatch = this.Dequeue(TimeSpan.FromMilliseconds(-1));
+            }
+            else
+            {
+                dispatch = this.Dequeue(timeout);
+            }
             
             if(dispatch == null)
             {
@@ -183,9 +192,18 @@
 		{
             CheckClosed();
             CheckMessageListener();
-    
+
+            MessageDispatch dispatch = null;
             SendPullRequest(-1);
-            MessageDispatch dispatch = this.Dequeue(TimeSpan.Zero);
+            
+            if(this.PrefetchSize == 0)
+            {
+                dispatch = this.Dequeue(TimeSpan.FromMilliseconds(-1));
+            }
+            else
+            {
+                dispatch = this.Dequeue(TimeSpan.Zero);
+            }
             
             if(dispatch == null)
             {
@@ -702,8 +720,6 @@
             } 
             else 
             {
-                Tracer.Debug("AckLater: Old Ack was not the same Ack type.");
-
                 // old pending ack being superseded by ack of another type, if is is not
a delivered
                 // ack and hence important, send it now so it is not lost.
                 if(oldPendingAck.AckType != (byte)AckType.DeliveredAck) 



Mime
View raw message