3

I wonder whether there is a way to use only lambda function when I dispatched a job in laravel.

What I'm using is below.

  • Laravel 5.8(PHP 7.2)
  • AWS SQS
  • Supervisord

In Laravel, I dispatch a job with SQS connection and job is in Laravel project. I searched how I can use SQS as a trigger for lambda function. And I found this document. ( Using AWS Lambda with Amazon SQS ) If I follow this document, I think I can run job in lambda. But In Laravel project, job will be run again. I want to use only lambda as a job.

How I can run only lambda function as a job?

1 Answer 1

2

No it is not possible. Sqs, database or redis are just for keeping the serialized(encoded etc) version of your laravel jobs. Here is the closest you may get;

  • Forget about sqs queue driver.
  • Implement your job in aws lambda.
  • Allow lambda to consume your sqs (policies, triggers etc listed in the documentation)
  • Make a request from your laravel app via aws php sdk or http request(guzzle, curl) to your sqs and let lambda to consume your sqs.
  • You may use some async driver to trigger your sqs requests asynchronous.
  • If you want to use sqs delay queue, The maximum is 15 minutes - here for the doc
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.