fn-native-java
fn-native-java copied to clipboard
Fn Project Native Java Function using GraalVM
Fn Project Native Java Function using GraalVM
Usage
- Build and deploy the function
fn deploy --app javafn --local
Note: Requires mvn CLI installed.
- Call the function
curl -d 'Leonardo' http://localhost:8080/r/javafn/native
FAQ: How to create a new Native Java Function using GraalVM?
-
Create a new Java function with
fn init --runtime java8. -
Add
reflection.jsonfile (see reflection.json example and GraalVM docs). -
Copy Dockerfile and change
CMDto your entrypoint. -
Change your func.yaml to use
dockerruntime and add build commands.
Note: More advanced use cases using fnproject/fdk-java are also working.