micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.04k stars 1.06k forks source link

Unable to pass arguments to Lambda Function in Graal #772

Closed ilopmar closed 5 years ago

ilopmar commented 5 years ago

When running lambda functions using Graal native image we could do something like this:

$ echo '{"memberStateCode":"es", "vatNumber":"B99286353"}' | ./vies-vat-validator

But not, while upgrading this guide http://guides.micronaut.io/micronaut-function-aws-lambda/guide/index.html#graal to use Micronaut 1.0.0 I don't know if it's possible to pass those arguments and how to do it.

If I try to start the docker container exposing the ports, for example, to be able to execute a curl, the application doesn't start:

$ docker run -p 8080:8080 vies-vat-validator
Error executing function (Use -x for more information): Error decoding JSON stream for type [request]: No content to map due to end-of-input
 at [Source: (BufferedInputStream); line: 1, column: 0]

I've pushed the docker image to docker hub. To pull it and do some tests:

$ docker pull ilopmar/vies-vat-validator

Environment Information

ilopmar commented 5 years ago

If needed, the changes to upgrade the guide to 1.0.0 and use Docker to build Graal native image are in this branch: https://github.com/micronaut-guides/micronaut-function-aws-lambda/tree/upgrade-1.0.0

graemerocher commented 5 years ago

With the following diff works as expected https://gist.github.com/graemerocher/2637fe74e6191ad8005db99e43ef16c4