DEV Community

Discussion on: Laravel as a microservice using GCP PubSub, an alternative to laravel queue.

Collapse
 
waterloomatt profile image
Matt Skelton • Edited

What is this actually doing? Sending a 409 response to GCP to indicate the task was not consumed? So will GCP immediately push the task again, until the task is completed? Won't this spam your API with GCP requests, or is there a smart delay between attempts?

if ($availableAt > time()) {
     return response()->noContent(409);
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
bernardwiesner profile image
Bernard Wiesner

Sorry for the late reply, didn't notice your question.

I forgot to mention in the article that you also need to configure exponential backoff on GCP, so you API does not get spammed.

cloud.google.com/pubsub/docs/handl...