This project entails a data processing pipeline where a Truck sends OBU (On Board Unit) data to a receiver service, which subsequently forwards the data to an Apache Kafka queue. A distance calculation service then retrieves data from Kafka to compute the distance traveled. This calculated distance is utilized by an invoicer service, which in turn invokes the invoice calculation service to compute charges based on the distance provided. Finally, the invoice service stores the data into a database.
Note
I didnt write too much code documentation so if you are curious, just read the test cases if you re wondering how the existing functionality works
- Protobuffers & GRPC
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- That you need to set the $GOPATH/bin directory in your path Just like this or whatever your go directly lives.
- And dont forget to install protobuf compiler
- protobuffer package & GRPC package
google.golang.org/protobuf google.golang.org/grpc/
AGG_HTTP_ENDPOINT=:4000
AGG_GRPC_ENDPOINT=:3001
AGG_STORE_TYPE=memory
Install Prometheus in a Docker container
docker run -p 9090:9090 -v ./.config/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
Installing prometheus golang client
go get github.com/prometheus/client_golang/prometheus
Installing Prometheus natively on your system
- Clone the repository
git clone https://github.com/promtheus/prometheus.git
- Install
cd prometheus
make build
- Run the Prometheus deamon
./promtheus --config.file=<your_config_file>yml
- In the projects case that would be (running from inside the project directory)
../prometheus/prometheus --config.file=.config/prometheus.yml
docker run --name kafka -p 9092:9092 -e ALLOW_PLAINTEXT_LISTENER=yes -e KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true bitnami/kafka:latest