BewareMyPower commented on code in PR #19874:
URL: https://github.com/apache/pulsar/pull/19874#discussion_r1144347883


##########
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:
   As I've explained here: 
https://github.com/apache/pulsar/pull/19874#issuecomment-1477421964
   
   Do you think we should fail the whole ACK if one of them message IDs is 
invalid?



-- 
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]

Reply via email to