Skip to content

Commit

Permalink
Use sendRequestWithId to add timeout to hasMessageAvailable (apache#1…
Browse files Browse the repository at this point in the history
…1600)

### Motivation

Add timeout for the reader.hasMessageAvailable(hasMsg).

### Modifications

Use `sendRequestWithId` instead if `sendCommand`, and former will get `OperationTimeout`.
  • Loading branch information
Sunny-Island authored Aug 9, 2021
1 parent 9311f7f commit 66a2b50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pulsar-client-cpp/lib/ClientConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,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();
}

Expand Down

0 comments on commit 66a2b50

Please sign in to comment.