You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "AnonHxy (via GitHub)" <gi...@apache.org> on 2023/01/30 02:35:34 UTC
[GitHub] [pulsar] AnonHxy commented on a diff in pull request #19354: [fix][client] Fix reader listener can't auto ack with pooled message.
AnonHxy commented on code in PR #19354:
URL: https://github.com/apache/pulsar/pull/19354#discussion_r1090126972
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsReaderImpl.java:
##########
@@ -83,8 +83,13 @@ public MultiTopicsReaderImpl(PulsarClientImpl client, ReaderConfigurationData<T>
@Override
public void received(Consumer<T> consumer, Message<T> msg) {
+ final MessageId messageId = msg.getMessageId();
readerListener.received(MultiTopicsReaderImpl.this, msg);
- consumer.acknowledgeCumulativeAsync(msg);
+ consumer.acknowledgeCumulativeAsync(messageId).exceptionally(ex -> {
+ log.error("[{}][{}] auto acknowledge message {} cumulative fail.", getTopic(),
+ getMultiTopicsConsumer().getSubscription(), msg.getMessageId(), ex);
Review Comment:
Will `msg.getMessageId()` throws NPE here? I think `msg.getMessageId()` should be changed to `messageId`
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org