I have a function with a simple test code like:
exports.helloPubSub = (event, context) => {
const message = event.data
? Buffer.from(event.data, 'base64').toString()
: 'Hello, World';
console.log(context);
throw new Error("Fail");
};
When I publish a message to Pub/sub the function fails and I expect that it will be called again with the same message after 600 seconds since the pub/sub subscription has Acknowledgement deadline set to 600 Seconds. But it does not work as expected looks like it acks the message immediately despite the failure in a cloud function.
According to the doc: Cloud Functions acks the message internally upon successful function execution.