Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ftiersch's avatar

Delayed Jobs on SQS Queue

Hey guys,

I'm running into a little trouble with delayed jobs in Laravel 5.2 and hope someone can point me in the right direction.

I'm developing a kind of Chat application and for a new feature I'd like to have email notifications if there are new messages for a user. In order to avoid unneccessary spam I want to delay the sending of the notification by 5 minutes or so and after that time check if the user maybe already read the new message so I don't need to send out the email.

The queues are running on Amazon SQS which works perfectly fine (it's already used for other e-mails and I can also see the messages in the AWS console). The problem is now that even using the delay() method with a value of e.g. 30 (but also 300) and calling php artisan queue:work afterwards the message get's handled immediately instead of being delayed.

Are delayed jobs not possible with Amazon or am I missing something here?

Thanks! Frank

0 likes
8 replies
ftiersch's avatar

Has no one ever used delayed jobs with AWS? :)

dave_ac's avatar

Same here, even if I manually create a message with AWS SQS console and set the Delay delivery of this new message to 60 seconds it gets consumed immediately.

ARRRRR!!!!

nafizcayli's avatar

I know this is an old thread but make sure you are not using FIFO queues as:

FIFO queues don't support timers on individual messages.

http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-timers.html

If you want to use delay in a FIFO queue, you need to set "Delivery Delay" for the whole queue. But this also makes all jobs pushed in the queue delayed by the "Delivery Delay" time.

http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html

Mirdrack's avatar

I'm using an standard SQS queue and it doesn't work

Is there anybody with success setting the delay for the jobs?

martinbean's avatar

@laradev_ Then create your own thread detailing the problem you’re having, instead of bumping a near-decade old thread.

Please or to participate in this conversation.