feat: add globalOptions support in SqsService with sqs endpoint property - #81
Open
marcin-zajac-pc wants to merge 5 commits into
Open
feat: add globalOptions support in SqsService with sqs endpoint property#81marcin-zajac-pc wants to merge 5 commits into
marcin-zajac-pc wants to merge 5 commits into
Conversation
eduardoazevedo3
approved these changes
May 31, 2024
martinchio
approved these changes
Jun 14, 2024
tisserasuneth
approved these changes
Jun 25, 2024
Owner
|
Thanks for addressing the issue with this PR. |
|
Do we know what state this is in? It would be great to stop seeing the warning message in the terminal. I can help with this pull request or generate the documentación myself, It thats all thats missing to add It. |
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.
Context
Related issue: Issue #78.
Problem
Currently, we're unable to set the SQS endpoint when the module is registered. As mentioned in the issue, when using an emulator, we receive warnings because the
queueUrlis composed from AWS credentials in the environment, which differs from local URLs such as those used by LocalStack.The error message suggests using the
useQueueUrlAsEndpointproperty, but I couldn't find that in the SQSClient options. However, setting theendpointdirectly resolves the issue.To provide more background, when running SQS locally using LocalStack, I set the SQS endpoint to
http://localhost:4566.Solution
I added an optional
globalOptionsobject property with anendpointfield to allow setting the endpoint directly on the SQSClient. The condition ensures that if the consumer/producer options have ansqsproperty, it won't be overwritten by the global one. I decided that consumer/producer options should take priority.This solution was tested locally and works as expected.
Other Thoughts
We can discuss adding more properties to the
globalOptions. I'm open to suggestions, but for now, I wasn't sure if anything else would be necessary.