quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.64k stars 2.65k forks source link

Smallrye + lambda extension is not injecting any request context variables #36171

Open jfalcos opened 1 year ago

jfalcos commented 1 year ago

Describe the bug

Hi everyone,

I created a sample project that has the quarkus-smallrye-graphql & quarkus-amazon-lambda-rest dependencies to test how would the integration look like. I'm planning on putting it in an AWS APIGateway and that worked just fine but when I try to inject the request context variables from API Gateway, I get nothing.

I attached my sample project. It's pretty barebones, just trying to get it to print the context.

I have successfully deployed it to an aws apigateway using the container native runtime and everything works except the context variables.

Appreciate any guidance or help with this! Thanks

sample project.zip

Expected behavior

Context variables should get injected

Actual behavior

I don't get any of the context variables in my output

{
    "data": {
        "sayHello": "Hello John [context1={\"requestTimeEpoch\":0}][context2={\"requestTimeEpoch\":0}][context3={}][context4={}]"
    }
}

How to Reproduce?

  1. Download the zip file.
  2. Deploy it to AWS APIGateway
  3. Make a request using
    { 
    sayHello(name: "John")
    }

as the body

Output of uname -a or ver

No response

Output of java -version

Java(TM) SE Runtime Environment Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14)

GraalVM version (if different from Java)

GraalVM 17.0.8+9.1

Quarkus version or git rev

3.4.1

Build tool (ie. output of mvnw --version or gradlew --version)

cmd /c call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && mvn install -Dnative -DskipTests -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3-java17

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @Karm (mandrel), @galderz (mandrel), @matejvasek (amazon-lambda), @patriot1burke (amazon-lambda), @zakkak (mandrel)

galderz commented 1 year ago

Can you reproduce the issue outside of AWS, say running locally? Also, do things work as expected in JVM mode?