You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2022/12/20 02:20:07 UTC

[rocketmq-clients] 04/04: C# SimpleConsumer should take request timeout into consideration when polling for messages

This is an automated email from the ASF dual-hosted git repository.

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git

commit 2e64474c520bf26b4d0d0f20422b71d608d5e072
Author: colprog <co...@gmail.com>
AuthorDate: Sat Dec 17 18:21:09 2022 +0800

    C# SimpleConsumer should take request timeout into consideration when polling for messages
---
 csharp/rocketmq-client-csharp/SimpleConsumer.cs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/csharp/rocketmq-client-csharp/SimpleConsumer.cs b/csharp/rocketmq-client-csharp/SimpleConsumer.cs
index 60f0ba94..12e5d8cf 100644
--- a/csharp/rocketmq-client-csharp/SimpleConsumer.cs
+++ b/csharp/rocketmq-client-csharp/SimpleConsumer.cs
@@ -219,9 +219,12 @@ namespace Org.Apache.Rocketmq
             var targetUrl = Utilities.TargetUrl(messageQueue);
             var metadata = new Metadata();
             Signature.Sign(this, metadata);
-            
-            return await Manager.ReceiveMessage(targetUrl, metadata, request, 
-                ClientSettings.Subscription.LongPollingTimeout.ToTimeSpan());
+
+            var timeout = ClientSettings.Subscription.LongPollingTimeout
+                .ToTimeSpan()
+                .Add(this.RequestTimeout);
+
+            return await Manager.ReceiveMessage(targetUrl, metadata, request, timeout);
         }