-
Notifications
You must be signed in to change notification settings - Fork 80
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
SQSEvent.getRecords() returns null for my Lambda's RequestHandler #1611
Comments
+1 same issue - #102 (comment) |
+1 |
+1 |
1 similar comment
+1 |
|
Is there any update on this issue? We faced the same with DynamodbEvent when processing events from a DynamoDb stream, but this issue occured only after the upgrade to Micronaut 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I used the
mn
cli to help me creating a simple lambda to be triggered by SQS. I changed the generated code to make it receiveSQSEvent
instead of the API Gateway request.After building the navite image and uploading it to AWS, when I trigger the lambda using a "SQSEvent" json, the lambda throws exception. I added some debugging code and I noticed that the SQSEvent.getRecords() method is returning null. It looks like some deserialization issue is happening.
It looks like this guy on stackoverflow had the same issue and he created a workaround to solve it. But I'm not satisfied with his solution.
Steps to reproduce
Created a simple lambda with this command:
Update the
FunctionRequestHandler
to make it receive an SQSEvent instead of API Gateway event.I created a
template.yml
file to be able to invoke locally with aws's "sam cli", and I receive the following error (the same that happens if I deploy the code to AWS):The
NewUserSqsMessage.json
file is this:Example that reproduces the problem uploaded to Github
https://github.com/bnegrao/micronaut-lambda-sqs
Expected Behaviour
I would be able to iterate and print the records (List<SQSEvent.SQSMessage>) from the event.
Actual Behaviour
sqsEvent.getRecords() returns null instead of returning a list with one element.
Environment Information
Example Application
The text was updated successfully, but these errors were encountered: