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 Thu, 01 Aug 2019 15:43:55 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 d3e3364  AMQNET-595: Set and get group-id message property field
     new a190b05  Merge pull request #12 from HavretGC/AMQNET-595_set_and_get_group-id_message_property_field
d3e3364 is described below

commit d3e3364ec8763804409cabb2d162654843ff0886
Author: Havret <h4vret@gmail.com>
AuthorDate: Thu Aug 1 16:50:17 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                             |  6 ++++++
 .../Message/Facade/NmsTestMessageFacade.cs                     |  1 +
 test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs            | 10 ++++++++++
 4 files changed, 18 insertions(+)

diff --git a/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs b/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs
index e91ef24..6520079 100644
--- a/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs
+++ b/src/NMS.AMQP/Message/Facade/INmsMessageFacade.cs
@@ -36,6 +36,7 @@ namespace Apache.NMS.AMQP.Message.Facade
         IDestination NMSReplyTo { get; set; }
         DateTime NMSTimestamp { get; set; }
         string NMSType { get; set; }
+        string GroupId { 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 1f81717..d78b300 100644
--- a/src/NMS.AMQP/Message/NmsMessage.cs
+++ b/src/NMS.AMQP/Message/NmsMessage.cs
@@ -94,6 +94,12 @@ namespace Apache.NMS.AMQP.Message
             get => Facade.NMSType;
             set => Facade.NMSType = value;
         }
+        
+        public string NMSGroupId
+        {
+            get => Facade.GroupId;
+            set => Facade.GroupId = value;
+        }
 
         public NmsAcknowledgeCallback NmsAcknowledgeCallback { 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 919eb58..1ebbc6b 100644
--- a/test/Apache-NMS-AMQP-Test/Message/Facade/NmsTestMessageFacade.cs
+++ b/test/Apache-NMS-AMQP-Test/Message/Facade/NmsTestMessageFacade.cs
@@ -73,6 +73,7 @@ namespace NMS.AMQP.Test.Message.Facade
         public IDestination NMSReplyTo { get; set; }
         public DateTime NMSTimestamp { get; set; }
         public string NMSType { get; set; }
+        public string GroupId { 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 b78bd96..3256ccc 100644
--- a/test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs
+++ b/test/Apache-NMS-AMQP-Test/Message/NmsMessageTest.cs
@@ -395,6 +395,16 @@ namespace NMS.AMQP.Test.Message
             Assert.Throws<MessageFormatException>(() => msg.Properties.GetFloat(name));
             Assert.Throws<MessageFormatException>(() => msg.Properties.GetDouble(name));
         }
+
+        [Test]
+        public void TestSetAndGetGroupId()
+        {
+            NmsMessage msg = factory.CreateMessage();
+            
+            msg.Properties.SetString("NMSGroupId", "testGroupId");
+            
+            Assert.AreEqual(msg.Facade.GroupId, "testGroupId");
+        }
         
         // TODO: Test conversion for other properties
 


Mime
View raw message