You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by mi...@apache.org on 2021/09/13 11:08:21 UTC

[activemq-nms-amqp] 04/09: AMQNET-718 Cancel inflight messages after send timeout + Resolve conflicts

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

commit 11f571fb9e04b21c2469abc2bda57ed298f0c423
Author: Havret <h4...@gmail.com>
AuthorDate: Wed Jun 9 00:12:41 2021 +0200

    AMQNET-718 Cancel inflight messages after send timeout + Resolve conflicts
---
 src/NMS.AMQP/Apache-NMS-AMQP.csproj                              | 2 +-
 src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs                       | 1 +
 test/Apache-NMS-AMQP-Test/Integration/ProducerIntegrationTest.cs | 4 ++++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/NMS.AMQP/Apache-NMS-AMQP.csproj b/src/NMS.AMQP/Apache-NMS-AMQP.csproj
index 835739d..ba57afa 100644
--- a/src/NMS.AMQP/Apache-NMS-AMQP.csproj
+++ b/src/NMS.AMQP/Apache-NMS-AMQP.csproj
@@ -94,7 +94,7 @@ with the License.  You may obtain a copy of the License at
 
     <ItemGroup>
         <!-- AMQPNetLite.Core is .NET Standard 1.3 package -->
-        <PackageReference Include="AMQPNetLite.Core" Version="2.4.1" />
+        <PackageReference Include="AMQPNetLite.Core" Version="2.4.3" />
         <PackageReference Include="Apache.NMS" Version="2.0.0" />
         <PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
     </ItemGroup>
diff --git a/src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs b/src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs
index 22ce43a..17770cc 100644
--- a/src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs
+++ b/src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs
@@ -171,6 +171,7 @@ namespace Apache.NMS.AMQP.Provider.Amqp
             }
             catch (TimeoutException)
             {
+                senderLink.Cancel(message);
                 throw;
             }
 
diff --git a/test/Apache-NMS-AMQP-Test/Integration/ProducerIntegrationTest.cs b/test/Apache-NMS-AMQP-Test/Integration/ProducerIntegrationTest.cs
index 18e0b9e..47076aa 100644
--- a/test/Apache-NMS-AMQP-Test/Integration/ProducerIntegrationTest.cs
+++ b/test/Apache-NMS-AMQP-Test/Integration/ProducerIntegrationTest.cs
@@ -642,6 +642,10 @@ namespace NMS.AMQP.Test.Integration
                 // send operation to time out.
                 testPeer.ExpectSenderAttach();
                 testPeer.ExpectTransferButDoNotRespond(messageMatcher: Assert.NotNull);
+                testPeer.ExpectDisposition(settled: true, state =>
+                {
+                    Assert.AreEqual(state.Descriptor.Code, MessageSupport.RELEASED_INSTANCE.Descriptor.Code);
+                });
                 testPeer.ExpectClose();
 
                 IMessageProducer producer = session.CreateProducer(queue);