Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow attachment of worker to Dead-letter queue #275

Merged
merged 7 commits into from
Nov 30, 2022

Conversation

whambulance
Copy link
Contributor

References Issue #188

Changes aimed at allowing a worker to be assigned as a handler to the dead letter queue. Also publishing the dlq ARN to the yaml file - similar to how the main queue ARN

Reasons:

  • It was difficult to add a worker to a DLQ compared to how easy it was to add one to the main queue
  • It would have required manually inserting the ARN into the YAML after having created the queue
  • Allowing additional manipulation of the DLQ due to exposure of it's ARN in the YAML file

@mnapoli
Copy link
Member

mnapoli commented Nov 4, 2022

Hi, I'm curious why you would want to have a worker on the DLQ?

@whambulance
Copy link
Contributor Author

whambulance commented Nov 4, 2022

Hi @mnapoli - In my specific scenario, I'm using SQS to handle making api calls to a third party provider. If their API is unavailable for some reason, the messages will get pushed into the DLQ, and I need to be able to retry these failed messages at a second provider. This means changing up the content of the message.

Here's another example from the AWS blog, written by some of their Solution Architects.

Essentially, there exists use cases where simply pushing the failed messages back into the main queue isn't viable, and additional processing is required.

@mnapoli
Copy link
Member

mnapoli commented Nov 4, 2022

Thanks for the explanation.

I think that falls outside of the scope of the construct, as it is right now. I don't see that feature being merged at the moment.

Maybe #128 is an alternative that has more chance of happening. Would that work for you?

@whambulance
Copy link
Contributor Author

As far as the base framework goes, exposing the URL allows you to send messages into the queue, but in order to consume messages from it I believe the ARN needs to be exposed?

Sadly I don't think this would be a viable solution - unless it's modified to expose the DLQ ARN too, similar to what I've done in this PR.

@mnapoli
Copy link
Member

mnapoli commented Nov 4, 2022

Yep, both could be exposed.

@whambulance
Copy link
Contributor Author

@mnapoli Updated to remove the dlqWorker construct, now only exposes dead letter queue URL & ARN

Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, that looks good! I have added a few comments inline.

Could you also rebase on master? The tests are now passing on master, and this should allow us to test this PR.

src/constructs/aws/Queue.ts Outdated Show resolved Hide resolved
src/constructs/aws/Queue.ts Outdated Show resolved Hide resolved
Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good, thanks!

@fredericbarthelet this is a very small addition, could be useful and was reported a few times. WDYT?

@fredericbarthelet
Copy link
Collaborator

LGTM :) Merging and issuing release now ;) thanks @whambulance for the contribution !

@fredericbarthelet fredericbarthelet merged commit 0ddd95e into getlift:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants