You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/10 11:12:34 UTC

[GitHub] [pulsar-client-go] wolfstudy commented on a diff in pull request #852: Fix ack/nack use closed consumer

wolfstudy commented on code in PR #852:
URL: https://github.com/apache/pulsar-client-go/pull/852#discussion_r991170235


##########
pulsar/consumer_impl.go:
##########
@@ -459,7 +459,9 @@ func (c *consumer) AckID(msgID MessageID) error {
 	}
 
 	if mid.consumer != nil {
-		return mid.Ack()
+		if pc, ok := (mid.consumer).(*partitionConsumer); ok && pc.getConsumerState() == consumerReady {
+			return mid.Ack()

Review Comment:
   Thanks @billowqiu work for this, can we abstract a public method to check if the consumer object is active?



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