Use Laravel Queue with Google Tasks on App Engine Standard

2.3k Views Asked by At

I'm running Laravel 6 on Google App Engine Standard and trying to make Laravel Queues work with Google Tasks natively.

Currently I'm creating (dispatching) and handling tasks with custom classes, but I would like to use Google task as native Laravel Queues, so I can call Job::dispatch() dispatch(new Job) and use Mail, Notification with Queueable. But unfortunately it is beyond my abilities and I can’t figure out how everything is interconnected in Laravel.

1

There are 1 best solutions below

2
On

Using Google Cloud API, you can create multiple queues for different target applications, deployed on Google App Engine in either Standard or Flexible environment.(Check here)

Here you can find detailed instructions on how to associate your Laravel project with Google Cloud Tasks processing asynchronous Jobs.

-Basically, you will create a task queue with a “queue.yaml” file, to handle the Cloud Tasks.

-Before Creating the Task:

---Pass the route of the API and the payload object for the Task.

---Authenticate userID in payload.

-Build/Create the Task. Using the method demonstrated on the example, it will use the Google API to build a Cloud Task and pass it to the task queue.

-Create the API routes in api.php.

-Create a TaskController which will route the different API to the specific (associateApp()) function.