-
Notifications
You must be signed in to change notification settings - Fork 543
pubsub/aws/snssqs to support SQS dead-letter queue #1066
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
Conversation
This reverts commit bcaa9bb.
# This is the 1st commit message: Improve error message in case of missing property (dapr#1012) Co-authored-by: Artur Souza <[email protected]> # This is the commit message dapr#2: Remove vestigial pubsub/nats code (dapr#1024) The pubsub/nats component was replaced by pubsub/natsstreaming as part of dapr/dapr#2003, but the corresponding code in dapr/components-contrib was not removed, so this change removes it. # This is the commit message dapr#3: bugfix for sns topic deletion upon termination # This is the commit message dapr#4: Revert "bugfix for sns topic deletion upon termination" This reverts commit bcaa9bb.
|
@halspang Please, check this PR with Matt. |
|
hi @artursouza . My integration tests over AWS are failing with 'missing region' which indicates that other AWS related envvars are indeed present in the build context (somehow)(i've set t.Skip in cases where the credentials related envvars are missing). Am I right? If so, I need another AWS envvar, namely |
well, the tests seem to pass ok now (maybe I saw a cached result). thanks anyways and sorry for the bother |
pubsub/aws/snssqs/snssqs.go
Outdated
| messageRetryLimit int64 | ||
| // if sqsDeadLettersQueueName is set to a value, then the deadLettersMaxReceives defines the number of times a message is received | ||
| // before it is moved to the dead-letters queue. This value must be smaller than messageRetryLimit | ||
| deadLettersMaxReceives int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be renamed to messageReceiveLimit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. I borrowed it from the AWS official param. but your suggestion makes sense
pubsub/aws/snssqs/snssqs.go
Outdated
| } | ||
|
|
||
| if val, ok := getAliasedProperty([]string{"deadLettersMaxReceives"}, metadata); !ok { | ||
| md.deadLettersMaxReceives = md.messageRetryLimit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make Max Receive mandatory? Mixing these can be confusing.
| @@ -0,0 +1,310 @@ | |||
| // ------------------------------------------------------------ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these to the e2e folder until we have a standardized way to write integration tests. See this as example: https://github.com/dapr/components-contrib/tree/master/tests/e2e/bindings/zeebe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is WIP and lots of work. So I think I'll open another PR for that. @artursouza wdyt? I've implemented the suggested changes (thanks, good ones!). I'm going to trigger a new build as it seem to glitch. please re-review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK for the E2E test to be in a separate PR. Once we have integration tests, it can land there too.
* not using implicit maxReceives * maxReceives renamed * unittest refactor
artursouza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small change. Plus, don't forget to remove the integ_test file.
pubsub/aws/snssqs/snssqs.go
Outdated
|
|
||
| const ( | ||
| awsSqsQueueNameKey = "dapr-queue-name" | ||
| awsSqsQueueNameKey = "dapr-worker-name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is a breaking change. This component is alpha but I would avoid breaking changes still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. you're right
Codecov Report
@@ Coverage Diff @@
## master #1066 +/- ##
==========================================
- Coverage 34.53% 34.03% -0.51%
==========================================
Files 132 134 +2
Lines 10870 11195 +325
==========================================
+ Hits 3754 3810 +56
- Misses 6736 6993 +257
- Partials 380 392 +12
Continue to review full report at Codecov.
|
* bugfix for sns topic deletion upon termination * Revert "bugfix for sns topic deletion upon termination" This reverts commit bcaa9bb. * wip on normalizing queue/topic names * sanitize queue and topic names * sanitized names. bugfix for close * # This is a combination of 4 commits. # This is the 1st commit message: Improve error message in case of missing property (dapr#1012) Co-authored-by: Artur Souza <[email protected]> # This is the commit message dapr#2: Remove vestigial pubsub/nats code (dapr#1024) The pubsub/nats component was replaced by pubsub/natsstreaming as part of dapr/dapr#2003, but the corresponding code in dapr/components-contrib was not removed, so this change removes it. # This is the commit message dapr#3: bugfix for sns topic deletion upon termination # This is the commit message dapr#4: Revert "bugfix for sns topic deletion upon termination" This reverts commit bcaa9bb. * removed debug message * raw string abort * merge issues solved * wip * gofmt+remove regex and use byte iter * wip. first impl of dead-letters queue config * wip. refactor and fallback values * integration test wip * wip integration test * wip integration * wip on testing * wip * still buggy but wip! * bugfix in dlq creation * working. still bug in subscription clean up * Update snssqs_integ_test.go * golangci-lint fixes * golangci-lint refactoring * trying to skip running integrations for snssqs * testing * skip integration test if no AWS related envvars are set (skip in CI) * parallel testing in unittests * code review fixes * not using implicit maxReceives * maxReceives renamed * unittest refactor * Update snssqs.go * integ removed, renaming back of const Co-authored-by: Maarten Mulders <[email protected]> Co-authored-by: Artur Souza <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Signed-off-by: Amit Mor <[email protected]>
Description
I've added 2 metadata fields which define:
Once those fields are set the deletion of messages after the
messageRetryLimitis not performed and the component assumes that the message is automatically moved by SQS to the defined DLQ.Additionally, I've added an integration test that runs either with AWS directly or locally using
localstack(sns,sqs,sts mockups) and tests 2 scenarios:Issue reference
#1065
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: