You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/01/05 20:23:42 UTC

svn commit: r896186 - in /activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp: Protocol/StompWireFormat.cs Session.cs

Author: tabish
Date: Tue Jan  5 19:23:42 2010
New Revision: 896186

URL: http://svn.apache.org/viewvc?rev=896186&view=rev
Log:
Fix some issues with failing unit tests.

Modified:
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Session.cs

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs?rev=896186&r1=896185&r2=896186&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs Tue Jan  5 19:23:42 2010
@@ -202,9 +202,16 @@
             message.CorrelationId = frame.RemoveProperty("correlation-id");
 
             Tracer.Debug("RECV - Inbound MessageId = " + frame.GetProperty("message-id"));
-            
+          
             message.MessageId = StompHelper.ToMessageId(frame.RemoveProperty("message-id"));
-            message.Persistent = StompHelper.ToBool(frame.RemoveProperty("persistent"), true);
+            message.Persistent = StompHelper.ToBool(frame.RemoveProperty("persistent"), false);
+
+            // If it came from NMS.Stomp we added this header to ensure its reported on the
+            // receiver side.
+			if(frame.HasProperty("NMSXDeliveryMode"))
+			{
+                message.Persistent = StompHelper.ToBool(frame.RemoveProperty("NMSXDeliveryMode"), false);
+            }
 
             if(frame.HasProperty("priority"))
             {
@@ -228,10 +235,17 @@
                 if(value != null)
                 {
                     // lets coerce some standard header extensions
-                    if(key == "NMSXGroupSeq")
+                    if(key == "JMSXGroupSeq" || key == "NMSXGroupSeq")
                     {
                         value = Int32.Parse(value.ToString());
+		                message.Properties["NMSXGroupSeq"] = value;
+						continue;
                     }
+					else if(key == "JMSXGroupID" || key == "NMSXGroupID")
+					{
+		                message.Properties["NMSXGroupID"] = value;
+						continue;
+					}
                 }
                 message.Properties[key] = value;
             }
@@ -279,8 +293,15 @@
                 frame.SetProperty("transaction", StompHelper.ToStomp(command.TransactionId));
             }
 
-            frame.SetProperty("persistent", command.Persistent);
+            frame.SetProperty("persistent", command.Persistent.ToString().ToLower());
+            frame.SetProperty("NMSXDeliveryMode", command.Persistent.ToString().ToLower());
 
+			if(command.NMSXGroupID != null)
+			{
+				frame.SetProperty("JMSXGroupID", command.NMSXGroupID);
+				frame.SetProperty("NMSXGroupID", command.NMSXGroupID);
+			}
+			
             // Perform any Content Marshaling.
             command.BeforeMarshall(this);
             
@@ -291,7 +312,7 @@
             {
                 frame.SetProperty("content-length", command.Content.Length);
             }
-
+			
             // Marshal all properties to the Frame.
             IPrimitiveMap map = command.Properties;
             foreach(string key in map.Keys)

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Session.cs?rev=896186&r1=896185&r2=896186&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Session.cs Tue Jan  5 19:23:42 2010
@@ -67,6 +67,10 @@
             {
                 this.transactionContext = new TransactionContext(this);
             }
+            else if(acknowledgementMode == AcknowledgementMode.DupsOkAcknowledge)
+            {
+                this.acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
+            }
 
             this.executor = new SessionExecutor(this, this.consumers);
         }