Event generator service using microservice architecture
Event Generator
This microservice is responsible to generate events. Events can be generated in two ways.
-
REST service '/punch' is exposed to post punch data
-
Sample events are generated at regular interval of 30 seconds with predefined data
Events are sent to kafka brokers. Its address and topics name has to be updated in application.properties file
Event Consumer
This microservice is responsible to consume events. It listen to specified topics of kafka broker, process it and then save it to embedded H2 database
To access events, REST service '/view-all' can be use to view all events
Events are consumed from kafka brokers' topics. Its address and name has to be updated in application.properties file
Dockerfile is also there to create docker image. if docker is running on same machine as the code then simply run: mvnw spring-boot:build-image
navigate to kubernetes-files, kubernetes deployment file can be use to deploy microservices in kubernetes Run command: kubectl create -f *-deployment.yml
Metrics
Actuators can be use to get metrics information. Access '/actuator/info' to get node info, '/actuator/metrics' to get metrics.
Prometheus micrometer dependency cam also be added to get all metrics from actuator
Swagger documentation
Swagger documentation can be accessed via '/swagger-ui/'