BewareMyPower commented on code in PR #19874:
URL: https://github.com/apache/pulsar/pull/19874#discussion_r1145786497
##########
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:
Fixed. PTAL again @315157973
--
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]