3

Is it possible to create Dead letter queue for cloud tasks (GCP) ?

I am using cloud tasks instead of pub/sub to have control over the concurrent massages send. However, unlike pub/sub, cloud task doesn't seem to use dead letter queue. Is there other ways to create one for cloud tasks.

Ken White
  • 123,280
  • 14
  • 225
  • 444
jelly
  • 31
  • 3
  • 1
    Maybe ... instead of thinking of a Dead Letter Queue, say to yourself "How do I know the task has failed?" ... wouldn't the answer be to look at the list of tasks and find the ones that are in failed state? Wouldn't that be the "set" of tasks that you need to remediate? Wouldn't this achieve the same effect as looking in a Dead Letter Queue for a failed to be delivered message? – Kolban Oct 19 '22 at 03:36
  • @Kolban assuming we store the processing state for those tasks in a database, how do we filter the tasks that weren't even picked up to be processed? – Ihan Dilnath Mar 02 '23 at 04:55

1 Answers1

1

It doesn't seem that Google Cloud Tasks offers a Dead-Letter abstraction similar to the PubSub subscription property.

However, in your project, you could use Cloud Monitoring, which is integrated with most Google Cloud services, to automatically monitor Cloud Task key metrics and maybe create alerts about:

  • Queue depth: The number of tasks in the queue.
  • Task attempt count: Count of task attempts broken down by response code.
  • Task attempt delay: Delay between each scheduled attempt time and actual attempt time in milliseconds.

That way someone could investigate if workers are keeping up with the flow of tasks by checking the metrics above.