简体   繁体   中英

How to handle errors during message acknowledgement using google pubsub java library?

I'm using the pubsub library and from time to time I'm getting this error, when I do message.ack()

Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Some acknowledgement ids in the request were invalid. This could be because the acknowledgement ids have expired or the acknowledgement ids were malformed.

However that error is raised in some thread that is not accessible to me. Is there a way to add an exception handler for acknowledgement?

The log level was downgraded from WARNING -> INFO in version 1.120.7

Does this change do what you were requesting?

You shouldn't need to do anything with this exception and so it's just in the log for informational purposes. The Pub/Sub library will retry acks that can be retried. If the ack ultimately fails, the messages will be redelivered.

The only place where you may need to handle failed acks is if you use exactly once delivery , which provides an ack method that returns a future that throws an exception if it fails.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM