A minimal hello world rule service.
You will need:
- Java 17+ installed
- Environment variable JAVA_HOME set accordingly
- Maven 3.9.6+ installed
When using native image compilation, you will also need:
- GraalVM 19.1.1 installed
- Environment variable GRAALVM_HOME set accordingly
- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to GraalVM installation documentation for more details.
mvn clean compile quarkus:dev
mvn clean package
java -jar target/quarkus-app/quarkus-run.jar
or on windows
mvn clean package
java -jar target\quarkus-app\quarkus-run.jar
Note that this requires GRAALVM_HOME to point to a valid GraalVM installation
mvn clean package -Pnative
To run the generated native executable, generated in target/
, execute
./target/rules-quarkus-helloworld-runner
Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon.
Once the service is up and running, you can use the following example to interact with the service.
Post "hello":
curl -H "Content-Type: application/json" -X POST -d '{"strings":["hello"]}' http://localhost:8080/hello
the service will return ["hello", "world"]