tree: 59693e06149a1cb9b1220ef78d9b7121a8862a5b [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/README.md

Kogito Serverless Workflow - Query Service Example

Description

This project contains a simple quarkus application that implements the external Query Service described in serverless-workflow-qas-service-showcase/README.md and where the queries are resolved. Please read it before to continue.

Infrastructure requirements

The same infrastructure requirements as described in Query Answer Service apply for this service.

Installing and Running

Prerequisites

The same prerequisites as described in Query Answer Service apply for this service.

Compile and Run in Local Dev Mode

mvn clean package quarkus:dev

Compile 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

Compile and Run in JVM mode using PostgreSQL persistence

To enable persistence, please append -Ppersistence to your Maven command. That will ensure the correct dependencies are in place and automatically set the required properties to connect with the PostgreSQL instance from the provided docker compose.

mvn clean package -Ppersistence 

Compile 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/query-service-{version}-runner

Submit a request

Use the following curl command to list all the pending queries in the query service:

 curl -X 'GET'  'http://localhost:8283/query-service'  -H 'accept: application/json'

Use the following curl command if you want to manually resolve a pending query:

curl -X 'POST' \
  'http://localhost:8283/query-service/resolveQuery' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "processInstanceId": "A valid SW process instance id -> 355eebfb-2c88-4f4a-969d-290197ddfc80",
  "queryResponse": "The response to send"
}'

Swagger UI

The swagger is also available in the following url: http://localhost:8283/q/swagger-ui