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.
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.
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.
Unfortunately Google Cloud Pub/Sub does not have a delay message option nativaly implemented. Messages are delivered as fast as possible. You can use Cloud Tasks for implement a delay service.
You can you this Tutorial: Deduplication, Delayed Messaging and FIFO with Google Pub/Sub as reference for implement the delay service using Pub/Sub + Cloud Tasks.