-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
AWS lambda extension fails to Deserialize trigger Classes correctly #14513
Comments
Forgot to mention the work around was to add a custom Date Deserializer to quarkus. It just seems like this should work out-of-the-box when using the aws lambda extension. |
You are not using the quarkus dynamo extension correct? I agree this should work out of the box. We're having a bit of problem with deserializing AWS event types. They all seem to follow a different pattern. Some of the classes don't have setter methods, and it looks like others like dynamo do different date serialization. |
lambda-deserializer-reproducer.tar.gz Indeed, I am not using the dynamo extension. It has 2 "integration" tests that mimick the behaviour on AWS. |
Issue still exists on Quarkus 1.12.0 |
Issue still exists in Quarkus 2.1.1 |
new version, V4, of Events library is coming aws/aws-lambda-java-libs#282 |
Issue still exists in Quarkus 3.6.7 |
Describe the bug
When running my DynamoDB-stream triggered lambda I receive the following error:
2021-01-21 01:37:10,665 ERROR [io.qua.ama.lam.run.AbstractLambdaPollLoop] (Lambda Thread) Failed to run lambda: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of
java.util.Dateout of VALUE_NUMBER_FLOAT token at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 196] (through reference chain: com.amazonaws.services.lambda.runtime.events.DynamodbEvent["Records"]->java.util.ArrayList[0]->com.amazonaws.services.lambda.runtime.events.DynamodbEvent$DynamodbStreamRecord["dynamodb"]->com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord["ApproximateCreationDateTime"]) ... at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop$1.run(AbstractLambdaPollLoop.java:78)
This happens because AWS passes unix timestamps as a float value with milliseconds after the decimal point.
My handleRequest method looks like this:
public LambdaResponse handleRequest(com.amazonaws.services.lambda.runtime.events.DynamodbEvent trigger, Context context)
I am using a native build(GraalVM), not sure if that matters.
Expected behavior
I expect the lambda to be trigger using a Strongly-Type Java Object as event.
Actual behavior
The lambda Crashes with a jackson Deserialization error.
To Reproduce
Will provide reproducer.
Steps to reproduce the behavior:
Configuration
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: