If the application invokes handler.nack() or allows handler to go out of scope, then the service will redeliver the message.
With exactly-once delivery subscriptions, the service will stop redelivering the message once the application invokes handler.ack() and the invocation succeeds. With best-efforts subscriptions, the service may redeliver the message, even after a successful handler.ack() invocation.
If handler is not an rvalue, you may need to use std::move(handler).ack() or std::move(handler).nack().
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-05 UTC."],[[["This webpage provides a list of versioned documentation for the `PullResponse` struct in the Google Cloud Pub/Sub C++ library, starting from version 2.11.0 up to the latest release candidate, 2.37.0-rc."],["The `PullResponse` struct is related to blocking pulls in the Pub/Sub service, and messages are redelivered if `handler.nack()` is called or if the handler goes out of scope."],["The service's redelivery behavior varies depending on whether the subscription uses exactly-once delivery or best-efforts delivery, with the former ceasing redelivery after a successful `handler.ack()` and the latter possibly redelivering even after successful acknowledgment."],["When using a non-rvalue handler, you might need to use `std::move(handler).ack()` or `std::move(handler).nack()`."],["The exactly-once delivery functionality is explained in the provided link : https://cloud.google.com/pubsub/docs/exactly-once-delivery."]]],[]]