Fix check if an event should be read as SQS event #98
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.
Motivation
With localstack/localstack#6603, the (incorrect) attribute "sqs" was removed from the event layout.
However, it seems this broke the javalibs, as they assumed that attribute to be present for the detection of a sqs event.
This PR will correct the incorrect assumption on the java util side, to allow SQSEvents to be properly created again.
Addresses localstack/localstack#6995 .
This only affects the local provider, but I fixed it regardless as it is a regression.
The whole logic isn't valid, we should inspect the lambda handler and check its type to use it, but implementing that (which is already implemented in the lambda java ric anyway) seems unnecessary if the local executor is deprecated anyway.
Changes
eventSource
attribute of a record to check if it is an sqs event, instead of the incorrect sqs key.