localstack / localstack-java-utils

☕ Java utilities and JUnit integration for LocalStack
Apache License 2.0
75 stars 43 forks source link

Fix check if an event should be read as SQS event #98

Closed dfangl closed 1 year ago

dfangl commented 1 year ago

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