This is a simple application that manages subscriptions requests:
- Saves the subscription state in a database.
- Notify about subscription changes in Kafka.
My idea is just to learn more about ZIO, I'm using as a guideline zio-petclinic
This app uses:
- ZIO Http for the HTTP server
- Tapir ZIO for endpoints and endpoint documentation
- ZIO JSON for JSON serialization
- ZIO Quill for SQL queries
- ZIO Config for app configuration and documentation
- Iron for refined types
- Start the services
docker compose -f docker/docker-compose.yaml up -d
- Start sbt
sbt
- Inside sbt, start the application
reStart
- Visit the swagger page to list the endpoints
http://localhost:8080/docs
- Inside sbt, stop the application
reStop
Once the application starts you can send requests to create/delete/update subscriptions and Kafka messages will be produced, in those cases, in a topic called subscriptions
notifying the changes, you can check those messages with tools like kcat:
kcat -C -b localhost:29092 -t subscriptions