[英]Laravel queue worker jobs fail when messages are sent back to SQS
I have set up my Laravel application to retrieve messages from an SQS queue. 我已经设置了Laravel应用程序来从SQS队列中检索消息。 Everything works fine during normal operation: Messages are added to the queue when a queueable job is dispatched, and the queue worker grabs the message from SQS and runs the job successfully.
在正常操作期间一切正常:在调度可排队作业时,消息将添加到队列中,队列工作程序从SQS获取消息并成功运行作业。
However, I run into problems whenever I use the "View Messages" feature in the SQS web console. 但是,每当我使用SQS Web控制台中的“查看消息”功能时,我都会遇到问题。 Here are the steps to reproduce:
以下是重现的步骤:
Why is this happening? 为什么会这样? I'm running Laravel 5.2.41 on PHP 5.6.
我在PHP 5.6上运行Laravel 5.2.41。
I figured out what was happening: 我弄清楚发生了什么:
To solve this, I added an extra retry "buffer" to my queue workers: 为了解决这个问题,我在队列工作者中添加了一个额外的重试“缓冲区”:
php artisan queue:work redis --tries=3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.