Ben Wilkins
Ben Wilkins

Reputation: 866

Laravel jobs pushed to Amazon SQS but not processing

I'm running Laravel 5.3. I'm attempting to test a queue job, and I have my queue configured to use Amazon SQS. My app is able to push a job onto the queue, and I can see the job in SQS. But it stays there, never being processed. I've tried running php artisan queue:work, queue:listen, queue:work sqs... None of them are popping the job off the queue. I'm testing this locally with Homestead. Is there a trick to processing jobs from SQS?

Upvotes: 5

Views: 5449

Answers (2)

codeymcgoo
codeymcgoo

Reputation: 583

The instructions in the following post worked for me: https://blog.wplauncher.com/sqs-queue-in-laravel-not-working/. In essence, make sure you do the following:

  • create your standard queue in SQS
  • update your config/queue.php file to use your SQS credentials (I would suggest - - adding more env vars to your .env file and referencing them in this file)
  • update your QUEUE_DRIVER in your .env, so it's set to QUEUE_DRIVER=SQS
  • update your supervisor configuration file (typically /etc/supervisor/conf.d/laravel-worker.conf)
  • update and restart supervisor (see the 3 commands mentioned by @Dijkstra)

Upvotes: 0

Shihab
Shihab

Reputation: 2679

I faced the same problem. I was using supervisor. This worked for me:

Mentioned queue driver in command (sqs):

command=php /var/www/html/artisan queue:work sqs --tries=3

Then ran these commands:

sudo supervisorctl reread

sudo supervisorctl update

sudo supervisorctl restart all

Posting this just in case it helps anyone.

Upvotes: 4

Related Questions