activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelpea...@apache.org
Subject [activemq-nms-amqp] branch master updated: AMQNET-595: Set and get group-id message property field
Date Mon, 05 Aug 2019 07:40:12 GMT
This is an automated email from the ASF dual-hosted git repository.

michaelpearce pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-nms-amqp.git


The following commit(s) were added to refs/heads/master by this push:
     new 228fa68  AMQNET-595: Set and get group-id message property field
     new 1495a1d  Merge pull request #13 from HavretGC/AMQNET-595_set_and_get_group-id_message_property_field
228fa68 is described below

commit 228fa68e73ac02eb6c7ed54978eb05cc02a7ef43
Author: Havret <h4vret@gmail.com>
AuthorDate: Mon Aug 5 09:28:21 2019 +0200

    AMQNET-595: Set and get group-id message property field
---
 src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs             |  1 +
 src/NMS.AMQP/Message/NmsMessage.cs                           | 10 ++++++++--
 .../Message/Facade/NmsTestMessageFacade.cs                   |  1 +
 test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs          | 12 +++++++++++-
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs b/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs
index 6520079..34bffd9 100644
--- a/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs
+++ b/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs
@@ -37,6 +37,7 @@ namespace Apache.NMS.AMQP.Message.Facade
         DateTime NMSTimestamp { get; set; }
         string NMSType { get; set; }
         string GroupId { get; set; }
+        uint GroupSequence { get; set; }
         DateTime Expiration { get; set; }
         sbyte JmsMsgType { get; }
         INmsMessageFacade Copy();
diff --git a/src/NMS.AMQP/Message/NmsMessage.cs b/src/NMS.AMQP/Message/NmsMessage.cs
index d78b300..9f9c1c9 100644
--- a/src/NMS.AMQP/Message/NmsMessage.cs
+++ b/src/NMS.AMQP/Message/NmsMessage.cs
@@ -94,13 +94,19 @@ namespace Apache.NMS.AMQP.Message
             get => Facade.NMSType;
             set => Facade.NMSType = value;
         }
-        
-        public string NMSGroupId
+
+        public string NMSXGroupId
         {
             get => Facade.GroupId;
             set => Facade.GroupId = value;
         }
 
+        public int NMSXGroupSeq
+        {
+            get => (int) Facade.GroupSequence;
+            set => Facade.GroupSequence = (uint) value;
+        }
+
         public NmsAcknowledgeCallback NmsAcknowledgeCallback { get; set; }
 
         public virtual bool IsReadOnly { get; set; }
diff --git a/test/Apache-NMS-AMQP-Test/Message/Facade/NmsTestMessageFacade.cs b/test/Apache-NMS-AMQP-Test/Message/Facade/NmsTestMessageFacade.cs
index 1ebbc6b..4f04440 100644
--- a/test/Apache-NMS-AMQP-Test/Message/Facade/NmsTestMessageFacade.cs
+++ b/test/Apache-NMS-AMQP-Test/Message/Facade/NmsTestMessageFacade.cs
@@ -74,6 +74,7 @@ namespace NMS.AMQP.Test.Message.Facade
         public DateTime NMSTimestamp { get; set; }
         public string NMSType { get; set; }
         public string GroupId { get; set; }
+        public uint GroupSequence { get; set; }
         public DateTime Expiration { get; set; }
         public sbyte JmsMsgType { get; }
         public INmsMessageFacade Copy()
diff --git a/test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs b/test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs
index 3256ccc..308bc53 100644
--- a/test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs
+++ b/test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs
@@ -401,11 +401,21 @@ namespace NMS.AMQP.Test.Message
         {
             NmsMessage msg = factory.CreateMessage();
             
-            msg.Properties.SetString("NMSGroupId", "testGroupId");
+            msg.Properties.SetString("NMSXGroupId", "testGroupId");
             
             Assert.AreEqual(msg.Facade.GroupId, "testGroupId");
         }
         
+        [Test]
+        public void TestSetAndGetGroupSequence()
+        {
+            NmsMessage msg = factory.CreateMessage();
+            
+            msg.Properties.SetInt("NMSXGroupSeq", 10);            
+            
+            Assert.AreEqual(msg.Facade.GroupSequence, 10);
+        }
+        
         // TODO: Test conversion for other properties
 
         [Test]


Mime
View raw message