SQS Duplicate messages handling

后端 未结 1 1614
难免孤独
难免孤独 2021-01-25 01:59

I am running a queue process using Amazons SQS and a separate machine that processes the jobs (a worker). I am also using the supervisor to make sure t

相关标签:
1条回答
  • 2021-01-25 02:15

    With SQS, once a worker takes an item - it is the worker's responsibility to immediately delete the item from SQS so that other workers will not get the item as well.

    This part of the documentation explains what amount of time you are allowed for, to delete the item - http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html

    Since you did not show the code of your e-mail sending Laravel worker, I can only guess that you are not deleting the SQS item immediately - but instead maybe deleting it only after the e-mail was sent. Should the e-mail sending part take more than SQS Visibility Timeout (described in the link document), it would make sense the same task is picked up by other workers.

    0 讨论(0)
提交回复
热议问题