Skip to content

Latest commit

 

History

History
72 lines (47 loc) · 2.03 KB

File metadata and controls

72 lines (47 loc) · 2.03 KB

Rules + Quarkus config example

Description

A minimal hello world rule service.

Installing and Running

Prerequisites

You will need:

  • Java 11+ installed
  • Environment variable JAVA_HOME set accordingly
  • Maven 3.8.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"]

Deploying with Kogito Operator

In the operator directory you'll find the custom resources needed to deploy this example on OpenShift with the Kogito Operator.