nodece commented on code in PR #24476:
URL: https://github.com/apache/pulsar/pull/24476#discussion_r2179321736


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##########
@@ -571,6 +571,11 @@ protected CompletableFuture<Void> 
doReconsumeLater(Message<?> message, AckType a
 
     @Override
     public void negativeAcknowledge(MessageId messageId) {
+        if (getState() != State.Ready) {
+            log.warn("[{}] [{}] Cannot negative acknowledge message {} - 
consumer is not ready (state: {})",

Review Comment:
   Would it be better to use `throw new PulsarClientException("Consumer is not 
ready: " + getStats().toString())` instead?
   
   I'm concerned that logging a warning might give users the impression that 
the issue is not critical(I know the consumer may be closed), we should handle 
it explicitly.



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