cqrs4j-quarkus-example-query
Query microservice that uses Quarkus, ddd-4-java and cqrs-4-java libraries. Events are stored in an EventStore and the query data is retrieved from a MariaDB database.
Prerequisites
Make sure you installed everything as described here.
Run the query microservice in development mode
- Open a console (Ubuntu shortcut = ctrl alt t)
- Start the query microservice:
cd ddd-cqrs-4-java-example/quarkus/query ./mvnw quarkus:dev - Opening http://localhost:8080/ should show the query welcome page
Overview
Running test in IDE
In case you want to run the integration test inside your IDE (Eclipse or other), you need to start the Eventstore and MariaDB before.
- Start the Eventstore Docker container:
docker run -d --name eventstore-node \
-p 2113:2113 \
-p 1113:1113 \
--rm \
eventstore/eventstore:release-5.0.9
- Start the MariaDB Docker container:
docker run -d --name mariadb \
-p 3306:3306 \
-e MYSQL_INITDB_SKIP_TZINFO=1 \
-e MYSQL_ROOT_PASSWORD=xyz \
-e MYSQL_DATABASE=querydb \
-e MYSQL_USER=mary \
-e MYSQL_PASSWORD=abc \
--rm \
mariadb:10.4
-
Run the test: QryPersonResourceIT.java
-
Run
docker psto see the CONTAINER IDs and stop the Eventstore and MariaDB withdocker stop <CONTAINER_ID>
TODO ... (Does currently not work)
OPTIONAL Build and run the query microservice in native mode
- Make sure you have enough memory (~6-8 GB) on your PC or VM
- Open a console (Ubuntu shortcut = ctrl alt t)
- Build the native executable
cd query ./mvnw verify -Pnative - Run the microservice
./target/cqrs4j-quarkus-example-query-1.0-SNAPSHOT-runner \ -Djava.library.path=$GRAALVM_HOME/jre/lib/amd64 \ -Djavax.net.ssl.trustStore=$GRAALVM_HOME/jre/lib/security/cacerts
Issues
