315157973 commented on code in PR #19874:
URL: https://github.com/apache/pulsar/pull/19874#discussion_r1144268868
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##########
@@ -496,8 +496,13 @@ protected CompletableFuture<Void>
doAcknowledge(List<MessageId> messageIdList,
}
topicToMessageIdMap.forEach((topicPartitionName, messageIds) -> {
ConsumerImpl<T> consumer = consumers.get(topicPartitionName);
- resultFutures.add(consumer.doAcknowledgeWithTxn(messageIds,
ackType, properties, txn)
- .thenAccept((res) ->
messageIdList.forEach(unAckedMessageTracker::remove)));
+ if (consumer != null) {
+
resultFutures.add(consumer.doAcknowledgeWithTxn(messageIds, ackType,
properties, txn)
+ .thenAccept((res) ->
messageIdList.forEach(unAckedMessageTracker::remove)));
+ } else {
+ log.warn("MessageIds whose owner topic is {} will be
discard because the consumer is not connected",
Review Comment:
Why not be consistent with the behavior of a single ack?
You secretly ignore the message.
The business thinks that the message has been acked, but it has not,
resulting in a ack hole there and Ledger can never be cleared.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]