You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/02/10 16:30:03 UTC

[GitHub] [activemq-nms-amqp] michaelpearce-gain commented on a change in pull request #62: AMQNET-637 Move LangVersion back to 7.3 in interop test

michaelpearce-gain commented on a change in pull request #62:
URL: https://github.com/apache/activemq-nms-amqp/pull/62#discussion_r573878528



##########
File path: test/Apache-NMS-AMQP-Interop-Test/NmsMessageConsumerTest.cs
##########
@@ -211,112 +213,120 @@ IMessageConsumer GetConsumer(string subscriptionName, String clientId)
                 receivedMessages.Add(2);
                 msg.Acknowledge();
             };
-            
+
             // Now send some messages
-            using ISession sessionProducer = Connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
-            ITopic topicProducer = sessionProducer.GetTopic(TestName);
-            using IMessageProducer producer = sessionProducer.CreateProducer(topicProducer);
-            for (int t = 0; t < 10; t++)
+            using (ISession sessionProducer = Connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
             {
-                ITextMessage producerMessage = sessionProducer.CreateTextMessage("text" + t);
-                producer.Send(producerMessage, MsgDeliveryMode.Persistent, MsgPriority.Normal, TimeSpan.Zero);
+                ITopic topicProducer = sessionProducer.GetTopic(TestName);
+                using (IMessageProducer producer = sessionProducer.CreateProducer(topicProducer))
+                {
+                    for (int t = 0; t < 10; t++)
+                    {
+                        ITextMessage producerMessage = sessionProducer.CreateTextMessage("text" + t);
+                        producer.Send(producerMessage, MsgDeliveryMode.Persistent, MsgPriority.Normal, TimeSpan.Zero);
+                    }
+                }
             }
 
             // Give it some time to process
             Thread.Sleep(TimeSpan.FromSeconds(2));
-            
+
             // Assert message was routed to multiple consumers
             Assert.AreEqual(2, receivedMessages.Distinct().Count());
             Assert.AreEqual(10, receivedMessages.Count);
         }
-        
+
         [Test, Timeout(60_000)]
         public void TestSharedDurableSubscription()
         {
-            (IMessageConsumer,ISession,IConnection) GetConsumer(string subscriptionName, String clientId)
+            (IMessageConsumer, ISession, IConnection) GetConsumer(string subName, String clientId)
             {
                 var connection = CreateAmqpConnection(clientId);
                 ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
                 var topic = session.GetTopic(TestName);
-                var messageConsumer = session.CreateSharedDurableConsumer(topic, subscriptionName);
+                var messageConsumer = session.CreateSharedDurableConsumer(topic, subName);

Review comment:
       why was this needed? def -1 on moving from full clear name to some abbreviation.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org