Our great sponsors
-
This article about tries to implement of clean architecture microservice using: 🚀 Kafka as messages broker gRPC Go implementation of gRPC MongoDB as database Jaeger open source, end-to-end distributed tracing Prometheus monitoring and alerting Grafana for to compose observability dashboards with everything from Prometheus
-
On top layer of our app handling, logging errors and process metrics for Prometheus. Repository with the source code and list of all used tools u can find here 👨‍💻 :) I hope this article is usefully and helpfully, I'll be happy to receive any feedbacks or questions :)
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
Good kafka docker setup with enclouded UI is confluent, but it's had huge images size and will download a half of world wide internet to your local pc.🤖 For this reason here as UI client i used kafdrop
-
For Go client in production usually used segmentio and sarama, both is good and up to you which one to chose, for this project i used segmentio. I didn't implement any interesting business logic here and didn't cover tests, because of not enough time at this moment. Our microservice can communicate by kafka, gRPC and REST.
-
Workers validate message body then call usecase, if it's returns error, try for retry, good library for retry is retry-go, if again fails, publish error message to very simple Dead Letter Queue as i said, didn't implement here any interesting business logic, so in real production we have to handle error cases in the better way. And after message success processed commit it.
-
and REST API handler using echo: