The purpose of this application was the challenge participation proposed by B2W hiring team.This api was specified and documented under Open API 3 standard and can be consulted on https://app.swaggerhub.com/apis-docs/luizinhoab/b2w-challenge/1.0.0 .
This application exposes a reactive rest microservice, under Java/Vert.x, with crud operations to handle planets persited on MongoDb.
Will need install OpenJDK 11 and Gradle 5.2 to build and run the app. Optionally install Docker to run the container with MongoDb and sample data loaded, is same image used in the integration tests.
docker build -t mongo-test . && docker run -p 0.0.0.0:27016:27016 --name mongo-dev -d -t -i mongo-test
Main Class: io.vertx.core.Launcher VM Options: -Dvertx.metrics.options.enabled=true -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.Log4j2LogDelegateFactory --add-exports java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true Program arguments: run io.starwars.planet.PlanetAPIVerticle -conf src/main/resources/conf/config-dev.json
java -Dvertx.metrics.options.enabled=true -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.Log4j2LogDelegateFactory --add-exports java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true -jar plane-api-<VERSION>.jar -conf src/main/resources/conf/config-dev.json
The project exposes two health resources with associated metrics, for this is needed, before run app, to set the Vm Option:
'-Dvertx.metrics.options.enabled=true`.
Exposed resources:
/health - with all metrics about Vertx instance running. /health/server - just with metrics about the api server.
-
OpenJDK 11 - Java 11
-
Vert.x - Eclipse Vert.x is a tool-kit for building reactive applications on the JVM.
-
Open API 3 - Design API
-
Gradle Dependency management and tasks automatization