awesome java apps with GraalVM and Java microservices frameworks
src: Awesome Java applications with GraalVM and Java microservices frameworks - 2023-03-22
Abstract
Demos on multiple frameworks to use GraalVM native images
- spring framework
- micronaute
- helidon
- quarkus Native image is natively supported by JUnit 5. We can compress native images with UPX.
Drawbacks:
- required build time step
- computational effort necessary at build time
- need a powerful machine with the same target architecture & OS
- use it with Github Actions https://github.com/marketplace/actions/github-action-for-graalvm
- develop in JIT for fast development, only use AOT for final deployment
- for best throughput, use profile-guided optimizations:
native-image --pgo-instrument MyMainClass ./mymainclass
native-image --pgo=profile.ipfrof MyMainClass ./mymainclass
- GraalVM & Reflection
- native image tries to resolve the target elements through a static analysis that detects calls to the Reflection API
- easier way to handle reflection: use the following configuration in the
native-maven-plugin
: