Skip to content
Advertisement

Google PubSub – Ack a message using ack_id

I have an architecture made of:

  • PubSub Topic ‘A’
  • Subscription ‘B’ on topic ‘A’ that pushes messages to the endpoint ‘X’
  • Cloud Function ‘C’ triggered by the endpoint ‘X’, runtime in Python

Everytime a new message is published on the topic ‘A’, the subscription ‘B’ pushes it to the endpoint ‘X’ that triggers the Cloud Function ‘C’.

The problem I’m facing is the ‘acking’ of the message. I’d add a step to the Cloud Function ‘C’ in order to manually ack the message with the ack_id but every thread I’ve found discourages the manual acking of the messages using the ack_id and I don’t know how to do in a different way…

Any suggestion? How can I manually ack messages?

Thanks in advance!

ps. This architecture is necessary because topic ‘A’ and Cloud Function ‘C’ stay in different projects

Advertisement

Answer

Manual ack is useless in push mode (Cloud Function directly plugged on the Topic, or a push subscription on the topic). To ack a message with a push subscription, the HTTP service must answer a valid HTTP code.

If you use pull subscription, you can perform manual ack with the ack_id.

Advertisement