activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hav...@apache.org
Subject [activemq-nms-amqp] branch 1.8.x updated: AMQNET-718 Cancel inflight messages after send timeout
Date Thu, 10 Jun 2021 21:00:39 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/1.8.x by this push:
     new 59677f2  AMQNET-718 Cancel inflight messages after send timeout
     new eedf139  Merge pull request #67 from Havret/cancel-inflight-messages-after-timeout
59677f2 is described below

commit 59677f20281501eb55d177370a1cfaef72be32c0
Author: Havret <h4vret@gmail.com>
AuthorDate: Wed Jun 9 00:12:41 2021 +0200

    AMQNET-718 Cancel inflight messages after send timeout
---
 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 90f8c20..5af3318 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.0" />
+        <PackageReference Include="AMQPNetLite.Core" Version="2.4.3" />
         <PackageReference Include="Apache.NMS" Version="1.8.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 4ccbdae..7d92c61 100644
--- a/src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs
+++ b/src/NMS.AMQP/Provider/Amqp/AmqpProducer.cs
@@ -170,6 +170,7 @@ namespace Apache.NMS.AMQP.Provider.Amqp
             senderLink.Send(message, deliveryState, Callback, manualResetEvent);
             if (!manualResetEvent.WaitOne((int) session.Connection.Provider.SendTimeout))
             {
+                senderLink.Cancel(message);
                 throw new TimeoutException(Fx.Format(SRAmqp.AmqpTimeout, "send", session.Connection.Provider.SendTimeout,
nameof(message)));
             }
             if (outcome == null)
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);

Mime
View raw message