This a microservice part of the "analysis" APP
This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
- It will get the "Regular" analysis request from Kafka
- It will wait some time pretending that it is doing something
- It will send back the status of the analysis to Kafka
NOTE: You have to install the domain objects to run the services and the test utilities to run the tests.
If you want to pull the latest commits of the domain repository, you can just run:
git submodule update --remote --merge
You can run your application in dev mode that enables live coding using:
./mvnw compile quarkus:dev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8083/q/dev/.
By default Quarkus listensn on port 5005 for a debugger. You can change this by appending the flag, "-Ddebug<>" as in the below examples. The parameter is optional, of course
This services uses the following environment variables:
- KAFKA_BOOTSTRAP_URLS
This service depends on Kafka which is started by the Docker Compose file that you can find in the analysis-support repository (it also creates a postgres that is not needed by this microservice but by others running the APP)
In the developer profile the local kafka and postgres will point to the ones deployed with docker-compose, so you could just run "./mvnw compile quarkus:dev" and you will be ready.
If you want to monitor the Kafka topics (while developing locally) and have Kafka's command line tools installed you can watch the topics with:
kafka-console-consumer --bootstrap-server localhost:9092 --topic orders-in --from-beginning
kafka-console-consumer --bootstrap-server localhost:9092 --topic orders-out --from-beginning
kafka-console-consumer --bootstrap-server localhost:9092 --topic regularprocess-in --from-beginning
kafka-console-consumer --bootstrap-server localhost:9092 --topic virusprocess-in --from-beginning
kafka-console-consumer --bootstrap-server localhost:9092 --topic web-updates --from-beginning
Orders can be sent directly to the topics with:
kafka-console-producer --broker-list localhost:9092 --topic <<TOPIC_NAME>>
First remember to install and setup the GraalVM environment variables:
GRAALVM_HOME=<PATH TO GRAALVM DIRECTORY>/graalvm-ce-java11-21.1.0
export GRAALVM_HOME
export PATH=${GRAALVM_HOME}/bin:$PATH
export JAVA_HOME=${GRAALVM_HOME}
NOTE: if you use docker instead of podman you can remove the "-Dquarkus.native.container-runtime=podman" part in the mvn commands and .... well.... just change the word "podman xxx" with "docker xxx" in the rest of commands.....
./mvnw clean package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=podman
podman build -f src/main/docker/Dockerfile.native -t <<REGISTRY>>/analysis-process-regular:<<VERSION>> .
podman push <<REGISTRY>>/analysis-process-regular:<<VERSION>>
If you want to test it locally, configure the appropiate vaiables pointing to the local kafka and postgres services
export KAFKA_BOOTSTRAP_URLS=localhost:9092
podman run -i --network="host" -e KAFKA_BOOTSTRAP_URLS=${KAFKA_BOOTSTRAP_URLS} <<REGISTRY>>/analysis-process-regular:<<VERSION>>