Copilot commented on code in PR #95:
URL: https://github.com/apache/activemq-nms-amqp/pull/95#discussion_r2188199432


##########
src/NMS.AMQP/Policies/DefaultRedeliveryPolicy.cs:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Apache.NMS.AMQP.Policies
+{
+    public class DefaultRedeliveryPolicy : Apache.NMS.Policies.RedeliveryPolicy
+    {
+        public override int GetOutcome(IDestination destination)
+        {
+            return 4; // MODIFIED_FAILED_UNDELIVERABLE

Review Comment:
   [nitpick] Avoid using a magic literal for the disposition outcome. Define a 
named constant or enum member (e.g., 
DispositionOutcome.ModifiedFailedUndeliverable) to improve readability and 
maintainability.
   ```suggestion
       public enum DispositionOutcome
       {
           ModifiedFailedUndeliverable = 4
       }
       public class DefaultRedeliveryPolicy : 
Apache.NMS.Policies.RedeliveryPolicy
       {
           public override int GetOutcome(IDestination destination)
           {
               return (int)DispositionOutcome.ModifiedFailedUndeliverable;
   ```



##########
test/Apache-NMS-AMQP-Test/Integration/ConsumerIntegrationTest.cs:
##########
@@ -1097,5 +1098,277 @@ public void TestRecoveredMessageShouldNotBeMutated()
                 testPeer.WaitForAllMatchersToComplete(2000);
             }
         }
+
+        [Test, Timeout(20_000)]
+        public void TestMessageNackedWhenRedeliveryCountExceeded()

Review Comment:
   [nitpick] The setup/receive/recover sequence is repeated in each test. 
Consider extracting a helper or parametrized test to reduce duplication and 
improve readability.



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to