-
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 S3Event deserialization fails #13544
Comments
Is there in JVM mode or native mode? |
jvm mode |
@goranopacic Just guessing here: shouldn't be there |
@matejvasek you can see this example: https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-java |
@matejvasek please be aware that this is SDK v2 and Lambda Java Events v3 library is a separate project that is included in pom.xml when you add quarkus lambda extension |
So, Quarkus integration with Lambda in JVM mode is done by using a RequestStreamHandler wrapper which uses the Jackson JSON parser to deserialize the stream to the target object of the Lambda. We do it this way so that Quarkus can control the creation of your Lambda class. The problem is that S3Event is not a class that is deserializable by Jackson. We are going to have to have specific integration for this as the Quarkus Lambda integration assumed only user classes for input and output. |
Oh...and there would be a similar issue with native lambdas for S3Events. |
I'll work on a patch to support this. |
@goranopacic See linked PR. |
superb! it works both ways - jvm and native. Here is my log from simple lambda showing uploaded file name (Native). Init and second execution with 1ms billing :). REPORT RequestId: c420634a-1e21-49b3-bb8e-9098667f451c Duration: 106.86 ms Billed Duration: 398 ms Memory Size: 256 MB Max Memory Used: 63 MB Init Duration: 290.92 ms I will post an Issue at AWS events project in order to make it more Jackson compatible so you don't have to do all these things. It is amazing that you managed to make it ready in such a short time. Thanks a lot! |
Describe the bug
AWS Lambda triggered by S3Event fails to start due to deserialization problem.
S3Event class is a part of AWS Lambda Java Events v3 library.
Expected behavior
Compiling exactly the same code with non-quarkus compiled AWS Lambda results in properly deserialized S3Event object.
Actual behavior
Logged Error in AWS CloudWatch log:
To Reproduce
mvn archetype:generate
-DarchetypeGroupId=io.quarkus
-DarchetypeArtifactId=quarkus-amazon-lambda-archetype
-DarchetypeVersion=1.10.0.Final
Configuration
no changes to default pom.xml generated by aws lambda quarkus Maven Archetype
application.properties:
quarkus.lambda.handler=test
Environment (please complete the following information):
Output of
uname -a
orver
:Darwin xxxx.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
Java version
java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.17.0, JRE 11 Mac OS X amd64-64-Bit 20191031_334 (JIT enabled, AOT enabled)
OpenJ9 - 77c1cf708
OMR - 20db4fbc
JCL - 775c5eb03a based on jdk-11.0.5+10)
Quarkus version or git rev:
Quarkus 1.10.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
):Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/apache-maven-3.6.3
Java version: 11.0.5, vendor: Eclipse OpenJ9, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11-openj9.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
The text was updated successfully, but these errors were encountered: