Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panga/fn-native-java
Fn Project Native Java Function using GraalVM
https://github.com/panga/fn-native-java
fnproject graalvm java
Last synced: 6 days ago
JSON representation
Fn Project Native Java Function using GraalVM
- Host: GitHub
- URL: https://github.com/panga/fn-native-java
- Owner: panga
- License: apache-2.0
- Created: 2018-06-23T19:44:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T18:17:09.000Z (over 6 years ago)
- Last Synced: 2024-04-14T15:19:38.504Z (7 months ago)
- Topics: fnproject, graalvm, java
- Language: Java
- Homepage: https://medium.com/criciumadev/serverless-native-java-functions-using-graalvm-and-fn-project-c9b10a4a4859
- Size: 15.6 KB
- Stars: 29
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fn Project Native Java Function using GraalVM
## Usage
1. Build and deploy the function
```
fn deploy --app javafn --local
```Note: Requires `mvn` CLI installed.
2. Call the function
```
curl -d 'Leonardo' http://localhost:8080/r/javafn/native
```## FAQ: How to create a new Native Java Function using GraalVM?
1. Create a new Java function with `fn init --runtime java8`.
2. Add `reflection.json` file (see [reflection.json](reflection.json) example and [GraalVM docs](https://github.com/oracle/graal/blob/master/substratevm/REFLECTION.md)).
3. Copy [Dockerfile](Dockerfile) and change `CMD` to your entrypoint.
4. Change your [func.yaml](func.yaml) to use `docker` runtime and add build commands.
Note: More advanced use cases using [fnproject/fdk-java](https://github.com/fnproject/fdk-java) are also working.