This is to demo vertx microservice. This simple microservice has a PUT endpoint to persist a JSON message in local filesystem and generate an id (UUID) and return. Also it has a curresponding GET endpoint to expose the same item for the given id.
./gradlew clean shadowJar
docker run -p 8080:8080 jaisonpjohn/vertx-demo
curl -v --header "Content-Type:application/json" --data '{"name" : "Egg Whisk", "price" : 3.99, "weight" : 150 }' -X PUT http://localhost:8080/products/
It uses drone.io to pull, test and build and publish artifacts to docker hub, on different github events. Please note, this project's final artifact is not a JAR file, it is a Docker image with the Jar and the JVM burned-in.
- Read port from config.yml file than code
- Add metrics - dropwizard
- Enable Access logs
- Trace-ability: Add correlation Id
- Use Autoincrement semver tags to version the artifacts
- Move fileAccess to separate layer (dao kind of) so that it can be easily swapped with an actual persistence layer later
- When doing point 5, Use light-weight DI frameworks like guice to bind different singleton 'beans' together
- When doing point 5, introduce a mocking framework so that we can spy on different layer's interaction and then code will be 'Unit' testable