[13.x] Respect SQS redrive policy for native dead letter queue routing#58729
Draft
vimarteleto wants to merge 1 commit intolaravel:masterfrom
Draft
[13.x] Respect SQS redrive policy for native dead letter queue routing#58729vimarteleto wants to merge 1 commit intolaravel:masterfrom
vimarteleto wants to merge 1 commit intolaravel:masterfrom
Conversation
|
Isn't this the same as retrying the failed job from the failed jobs db table? DLQ is for the cases when the job gives fatal more than 3 times (default for SQS) and laravel does not delete it from SQS, nor puts it into failed jobs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an SQS queue has a redrive policy configured, Laravel currently deletes every message from the queue after processing, including failed jobs. This prevents SQS from ever moving failed messages to the dead letter queue, since deleted messages can't be redriven.
This PR makes the SQS driver aware of the queue's redrive policy so that:
1 - Failed jobs are not deleted from SQS when a redrive policy is configured on AWS, allowing SQS to natively route them to the dead letter queue after
maxReceiveCountis exceeded.2 -
maxTries()is derived frommaxReceiveCount, aligning Laravels retry mechanism with the SQS redrive policy.Expected behavior:
Job succeeds, no redrive policy > delete from SQS;
Job succeeds, has redrive policy > delete from SQS;
Job fails, no redrive policy > delete from SQS;
Job fails, has redrive policy > dont delete from SQS, DLQ routing