-
Notifications
You must be signed in to change notification settings - Fork 196
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
Dead letter queues #6033
Comments
@Chriscbr - can you please share some guidelines? |
I can pick up this one |
Amazing @marciocadev ! All yours |
Oh great @marciocadev , you just made my request to make sure it also works on awscdk much simpler |
Using a Lambda |
no problem @garysassano I can set the onFailure destination to send messages to dlq |
|
Guys, it's only possible to add a dead-letter queue (DLQ) to a lambda if the event producer is an asynchronous resource (such as Topic, DynamoDB and Bucket events, EventBridge events, etc). The lambda that consumes an event from a Queue, for example, cannot have a DLQ because SQS is a synchronous resource; it waits for a response from the function and handles accordingly. The API Gateway also faces the same issue. I'm saying this because I don't think the example In the case of Wing, I think the best example would be to add a DLQ to a lambda that consumes asynchronous resources such as Topic, Schedule, Bucket events, etc.
|
That's a good callout @marciocadev - yeah, I'm not sure if the suggested API for adding DLQs on Dead letter queues for If we want to support AWS specific features / aren't sure if the design work to support this across other clouds is needed right now, it's possible we could first incubate some of these capabilities through AWS classes and methods, e.g. let topic = new cloud.Topic();
let deadLetters = new cloud.Queue();
if let topic = aws.Topic.from(topic) {
topic.onMessage(inflight(msg: str) => {...}, dlq: deadLetters);
} |
Maybe we can add support to function dlqs in a winglib, that way we can define as specific for aws |
⛔ As the dead-letter queue linked to the function is a specific case of AWS, I will remove it from the scope of this PR. - [x] dlq (with retries) for queue (tf-aws / awscdk) - [x] dlq (with retries) for queue (sim) ~dlq for function (tf-aws / awscdk)~ ~dlq for function (sim)~ Closes #6033 ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Congrats! 🚀 This was released in Wing 0.71.2. |
Use Case
I'd like to be able to specify dead letter queues in Wing for
cloud.Function
s andcloud.Queue
s.Proposed Solution
Implementation Notes
For AWS:
Component
SDK
Community Notes
The text was updated successfully, but these errors were encountered: