From dfbbd4a81980edd77b44bb43687385d4c43d31b6 Mon Sep 17 00:00:00 2001 From: Michael Schnell Date: Thu, 26 Dec 2019 08:29:07 +0100 Subject: [PATCH] Enhanced doc --- quarkus/README.md | 81 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/quarkus/README.md b/quarkus/README.md index d18e266..dcf3bb7 100644 --- a/quarkus/README.md +++ b/quarkus/README.md @@ -6,7 +6,7 @@ Make sure you have the following tools installed: * [git](https://git-scm.com/) (VCS) * [Docker CE](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) * [Docker Compose](https://docs.docker.com/compose/) -* [GraalVM](https://www.graalvm.org/) +* *OPTIONAL* [GraalVM](https://www.graalvm.org/) Or simply use the [lubuntu-developer-vm](https://github.com/fuinorg/lubuntu-developer-vm) that has already everything installed. Then execute the following steps: @@ -24,45 +24,41 @@ Then execute the following steps: 4. OPTIONAL: Change memory of virtual machine to 8 GB (instead of 4 GB default) if you want to create a native image with GraalVM ## Getting started -1. Open a console (Ubuntu shortcut = ) +1. Open a console (Ubuntu shortcut = ctrl alt t) 2. Clone the git repository ``` git clone https://github.com/fuinorg/ddd-cqrs-4-java-example.git ``` -3. Change into the new directory and start Event Store and PostgreSQL using Docker Compose - ``` - cd ddd-cqrs-4-java-example/quarkus - docker-compose up - ``` - (Wait until everything is started) -4. Open another console (Ubuntu shortcut = ctrl alt t) -5. Change into the quarkus directory and build the project +3. Change into the quarkus directory and build the project ``` cd ddd-cqrs-4-java-example/quarkus ./mvnw install ``` + +## Start Event Store and Maria DB +1. Open a console (Ubuntu shortcut = ctrl alt t) +2. Change into the quarkus directory and run Docker Compose + ``` + cd ddd-cqrs-4-java-example/quarkus + docker-compose up + ``` +## Run the command microservice in development mode +1. Open a console (Ubuntu shortcut = ctrl alt t) +2. Start the command microservice: + ``` + cd ddd-cqrs-4-java-example/quarkus/command + ./mvnw quarkus:dev + ``` + ## Run the query microservice in development mode -1. Open a console (Ubuntu shortcut = ) +1. Open a console (Ubuntu shortcut = ctrl alt t) 2. Start the query microservice: ``` cd ddd-cqrs-4-java-example/quarkus/query ./mvnw quarkus:dev ``` -## Build and run the query microservice in native mode -1. Make sure you have enough memory (~6-8 GB) on your PC or VM -2. Open a console (Ubuntu shortcut = ) -3. Build the native executable - ``` - cd query - ./mvnw verify -Pnative - ``` -4. 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 - ``` - ## Test 1. Open [http://localhost:2113/](http://localhost:2113/) to access the event store UI (User: admin / Password: changeit) 2. Opening [http://localhost:8080/persons](http://localhost:8080/persons) should show an empty JSON array @@ -76,3 +72,40 @@ Then execute the following steps: ```json [{"id":"f645969a-402d-41a9-882b-d2d8000d0f43","name":"Peter Parker"}] ``` + +## Stop Event Store and Maria DB and clean up +1. Stop Docker Compse (Ubuntu shortcut = ctrl c) +2. Remove Docker Compose container + ``` + docker-compose rm + ``` + + +# TODO ... (Does currently not work) + +## *OPTIONAL* Build and run the command microservice in native mode +1. Make sure you have enough memory (~6-8 GB) on your PC or VM +2. Open a console (Ubuntu shortcut = ) +3. Build the native executable + ``` + cd command + ./mvnw verify -Pnative + ``` +4. Run the microservice + ``` + ./target/cqrs4j-quarkus-example-command-1.0-SNAPSHOT-runner -Djava.library.path=$GRAALVM_HOME/jre/lib/amd64 -Djavax.net.ssl.trustStore=$GRAALVM_HOME/jre/lib/security/cacerts + ``` + +## *OPTIONAL* Build and run the query microservice in native mode +1. Make sure you have enough memory (~6-8 GB) on your PC or VM +2. Open a console (Ubuntu shortcut = ) +3. Build the native executable + ``` + cd query + ./mvnw verify -Pnative + ``` +4. 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 + ``` + \ No newline at end of file