You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2021/08/11 01:55:02 UTC

[pulsar] branch branch-2.7 updated: Use sendRequestWithId to add timeout to hasMessageAvailable (#11600)

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

penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 54d8f1e  Use sendRequestWithId to add timeout to hasMessageAvailable (#11600)
54d8f1e is described below

commit 54d8f1e9f0d33d6d9e499fa3b86e2df6b329c45d
Author: Jiabei Zhao <41...@users.noreply.github.com>
AuthorDate: Mon Aug 9 16:15:13 2021 +0800

    Use sendRequestWithId to add timeout to hasMessageAvailable (#11600)
    
    ### Motivation
    
    Add timeout for the reader.hasMessageAvailable(hasMsg).
    
    ### Modifications
    
    Use `sendRequestWithId` instead if `sendCommand`, and former will get `OperationTimeout`.
    
    (cherry picked from commit 66a2b500b21073c5a5e65e78a82935af925d8268)
---
 pulsar-client-cpp/lib/ClientConnection.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-client-cpp/lib/ClientConnection.cc b/pulsar-client-cpp/lib/ClientConnection.cc
index 3442c89..311e44e 100644
--- a/pulsar-client-cpp/lib/ClientConnection.cc
+++ b/pulsar-client-cpp/lib/ClientConnection.cc
@@ -1514,7 +1514,7 @@ Future<Result, MessageId> ClientConnection::newGetLastMessageId(uint64_t consume
 
     pendingGetLastMessageIdRequests_.insert(std::make_pair(requestId, promise));
     lock.unlock();
-    sendCommand(Commands::newGetLastMessageId(consumerId, requestId));
+    sendRequestWithId(Commands::newGetLastMessageId(consumerId, requestId), requestId);
     return promise.getFuture();
 }