codelipenghui commented on a change in pull request #2508: PIP-22: Dead Letter Topic URL: https://github.com/apache/incubator-pulsar/pull/2508#discussion_r216567558
########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java ########## @@ -265,7 +265,8 @@ public SendMessageInfo sendMessages(final List<Entry> entries, SendListener list if (i == (entries.size() - 1)) { promise = writePromise; } - ctx.write(Commands.newMessage(consumerId, messageId, metadataAndPayload), promise); + int redeliveryCount = subscription.getDispatcher().getRedeliveryTracker().getRedeliveryCount(PositionImpl.get(messageId.getLedgerId(), messageId.getEntryId())); Review comment: After i check the pending acks in consumer, i recommend use redeliveryTracker to track the redelivery count: First, in a subscription only have one redelivery tracker, pending acks is binding to consumer, we don't need to record redelivery count per consumer and if record it in consumer, will get a different behavior is`max redelivery count per consumer`, but for now we defined the redelivery count per subscription. Second, i think we need separate pending acks and redeliveryTracker, it's better to implement another redeliveryTracker. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services