Giter Site home page Giter Site logo

analysis-process-regular's Introduction

analysis-process-regular project

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/ .

What does this microservice?

  • 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

Local Development

NOTE: You have to install the domain objects to run the services and the test utilities to run the tests.

Updating submodules

If you want to pull the latest commits of the domain repository, you can just run:

git submodule update --remote --merge

Running the application in dev mode

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/.

Attaching a debugger

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

Dependencies

Environment Variables

This services uses the following environment variables:

  • KAFKA_BOOTSTRAP_URLS

Kafka

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>>

Packaging and publishing the application to a repository

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>>

analysis-process-regular's People

Contributors

luisarizmendi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.