Skip to content

Commit

Permalink
[fix][client] Fix RawReader hasMessageAvailable returns true when no …
Browse files Browse the repository at this point in the history
…messages (#21032)
  • Loading branch information
Technoboy- committed Oct 24, 2023
1 parent e127ca2 commit c8abba8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,13 @@ void tryCompletePending() {
// TODO message validation
numMsg = 1;
}
MessageIdData messageId = messageAndCnx.msg.getMessageIdData();
lastDequeuedMessageId = new BatchMessageIdImpl(messageId.getLedgerId(), messageId.getEntryId(),
messageId.getPartition(), numMsg - 1);
if (!future.complete(messageAndCnx.msg)) {
messageAndCnx.msg.close();
closeAsync();
}
MessageIdData messageId = messageAndCnx.msg.getMessageIdData();
lastDequeuedMessageId = new BatchMessageIdImpl(messageId.getLedgerId(), messageId.getEntryId(),
messageId.getPartition(), numMsg - 1);

ClientCnx currentCnx = cnx();
if (currentCnx == messageAndCnx.cnx) {
increaseAvailablePermits(currentCnx, numMsg);
Expand Down

0 comments on commit c8abba8

Please sign in to comment.