[improve][broker] Remove check ack.getMessageIdsCount() == 1 for cumulative ack
@@ -425,8 +425,8 @@ public class Consumer {
subscription, consumerId);
return CompletableFuture.completedFuture(null);
}
- PositionImpl position = PositionImpl.EARLIEST;
- if (ack.getMessageIdsCount() == 1) {
+
+ PositionImpl position;
MessageIdData msgId = ack.getMessageIdAt(0);
if (msgId.getAckSetsCount() > 0) {
long[] ackSets = new long[msgId.getAckSetsCount()];
@@ -437,7 +437,7 @@ public class Consumer {
} else {
position = PositionImpl.get(msgId.getLedgerId(), msgId.getEntryId());
}
- }
+
if (ack.hasTxnidMostBits() && ack.hasTxnidLeastBits()) {
List<PositionImpl> positionsAcked = Collections.singletonList(position);
future = transactionCumulativeAcknowledge(ack.getTxnidMostBits(),
