Messaging-API

In this simple API, we connect to PostgreSQL and Kafka to obtain and manage cars inventory

This repo is used to showcase some concepts of resiliency and observability all in an effort to ease the reality of folks who need to operate and support the application.

Prerequisites

  • Docker environment
  • Minikube

Setup

Run PostgreSQL

docker container rm -f cars-postgres
docker run --name cars-postgres -p 5432:5432 -e POSTGRES_PASSWORD=carsdb -d postgres

Run Kafka using the official docker-compose

Run the API

Running the API will initialise the DB using flyway

./mvnw clean verify
./mvnw spring-boot:run

Confirm that the API is up by calling the following GET

curl localhost:8080/cars

TODO

  1. enable logs and add INFO and DEBUG level logs
  2. document actuator logger API calls for dynamic log changes
  3. add unit and integration tests with testcontainers
  4. take down postgresql and showcase app reaction
  5. showcase example of custom health check for postgres (connect to postgres AND verify specific table exists)
  6. document an operations runbook on how to investigate a specific kind of log
  7. Showcase on a different feature branch useless/lacking logs VS clean logs

GitHub

View Github