Reputation: 102507
I am using the asynchronous pull of Cloud Pub/Sub
For now, when I call message.nack()
method, it will re-delievery this message immediately.
subscription.on('message', (message) => {
message.nack();
})
How to delay the re-delivery?
For example, I got a message with publishTime: '2019-05-28T10:24:31.055Z'
I want to let this message re-delivery 20 seconds(computed) later from last delivery.
Upvotes: 0
Views: 1911
Reputation: 715
you can delay it by few setting in subscription
Upvotes: 0
Reputation: 369
You can now configure a retry policy in your Cloud Pub/Sub subscription. Retry policy allows users to have per message exponential backoff in case of failures.
More information can be found here.
Upvotes: 0
Reputation: 17251
There is currently no way in Cloud Pub/Sub to delay the redelivery of a message. When a message is nacked, it is immediately a candidate for redelivery to the same subscriber or to another subscdriber.
Upvotes: 1