Publish a pubsub message with a delay

Viewed 1024

I am looking for a way to publish a pubsub message with a one minute delay. I have roamed through their API yet couldn't find a way at all. Can anyone be helpful for me in this?

A good descriptive answer would be much appreciated.

2 Answers

Cloud Pub/Sub does not support delayed publishing. Cloud Tasks does support feature, allowing you to schedule the delivery of a message to subscribers when a message is published. The Task type, which is the object that is stored in the task queue, has a schedule_time field that can be specified when the Task is published via a CreateTask request. If you need this type of control over message delivery, then Cloud Tasks may be a better choice.

Related