Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 1.76 KB

File metadata and controls

68 lines (45 loc) · 1.76 KB

Rules + Quarkus config example

Description

A minimal hello world rule service.

Installing and Running

Prerequisites

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.

Compile and Run in Local Dev Mode

mvn clean compile quarkus:dev

Package and Run in JVM mode

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

Package and Run using Local Native Image

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.

Example Usage

Once the service is up and running, you can use the following example to interact with the service.

POST /hello

Post "hello":

curl -H "Content-Type: application/json" -X POST -d '{"strings":["hello"]}' http://localhost:8080/hello

the service will return ["hello", "world"]