fix(ecs-patterns): add validation for queue and queue related props#21717
Conversation
…riod, visibilityTimeout and maxReceiveCount have no effect when queue is specified.
TheRealAmazonKendra
left a comment
There was a problem hiding this comment.
Thank you for your contribution! We need tests for this change before we can provide a meaningful review.
| if (props.queue && (props.retentionPeriod || props.visibilityTimeout || props.maxReceiveCount)) { | ||
| throw new Error('retentionPeriod, visibilityTimeout and maxReceiveCount can be set only when queue is not set. Specify them in the QueueProps of the queue'); |
There was a problem hiding this comment.
We should probably have different error messages depending on which prop is provided that shouldn't be. It may be confusing if all are listed and a customer hasn't provided them all.
There was a problem hiding this comment.
Thank you very much for your quick reviews!
Added some unit tests and fixed the error messages.
Pull request has been modified.
|
@Mergifyio update |
✅ Branch has been successfully updated |
TheRealAmazonKendra
left a comment
There was a problem hiding this comment.
Looks great! Thanks!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Problem
When queue construct is set, queue related props (maxReceiveCount, visibilityTimeout, retentionPeriod) have no effect to the queue of the
QueueProcessingService. I think this is a reasonable behavior, but it is difficult to notice when wrongly configured.Fix
This pull request adds a validation to prevent from setting both queue and queue related props at the same time, and notice users the configuration error. Also, updates the param docs for this behavior.
All Submissions:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license