Java 24+needs to be installedexport JAVA_HOME=$(/usr/libexec/java_home -v 24)Mavenneeds to be installedDockerneeds to be installed- Install any Java IDE (
Eclipse,STS,Intellijetc..) and ensure you are able to launch - Clone or checkout the project from version control system (
git) and follow below steps
-
Java 24 -
Spring Boot 3 -
H2 Database(Default values are provided below)Default H2 Database Url: http://localhost:8080/h2-consoleusername:sapassword:saurl:jdbc:h2:mem:MB_TEST;DB_CLOSE_DELAY=-1
-
Flywayfor database migration -
Centralize exception handling by
ControllerAdvice -
Mapstructto map different type of objects to each other -
Micrometerdependencies were added to track the logs easily -
Testcontainersdependencies were added for integration tests -
docker-compose.ymlcontainsGrafana,PrometheusandZipkinto track metrics,Kafkafor event-driven architecture,Redisfor caching,Elasticsearch,Kibana, andLogstashfor search, analytics engine and logs,PostgreSQLandMongoDBfor data storage.- Kafka and its UI are included for message streaming, while the Elastic Stack (Elasticsearch, Logstash, Kibana) is set up for log management and visualization.
- All services are connected through
bridgenetworks, ensuring communication between containers. Actuator: http://localhost:8080/actuatorKafka UI: http://localhost:9999/Grafana- Login Credentials
- Url: http://localhost:3000/
- Email or username:
admin - Password:
admin
- Add
PrometheusDatasource - Add Dashboards
- Login Credentials
PrometheusActuator: http://localhost:8080/actuator/prometheusPrometheus: http://localhost:9090/graph
Zipkin UI: http://localhost:9411Elasticsearch: http://localhost:9200/Kibana: http://localhost:5601/app/home#/- Connect Spring Boot to
Elasticsearch(TESTED FOR SPRING BOOT 3) - Run Spring Boot project
- Open http://localhost:5601/app/home#/ -->
Discover-->Create data view->Name should be Index name-->Save date view to Kibana
- Connect Spring Boot to
Database credentialsPostgreSQLurl:jdbc:postgresql://localhost:5432/localdbusername:testpassword:test
MongoDBurl:mongodb://localhost:27017/testdb?authSource=adminusername:rootpassword:example
-
Test via
Postman(OPTIONAL):- Import Postman Collection
- Right-click the imported Postman Collection and click Run Collection section.
- On the right panel choose Functional or Performance section, edit Run configuration and click run to test the application.
- Please follow the following steps, if you want to build and run Spring Boot Application
*** Run the application by following these steps.
1 - cd live-data-service
2 - docker-compose up -d
3 - ./mvnw clean install or mvn clean install or mvn clean package
4 - ./mvnw spring-boot:run or mvn spring-boot:run
- Please follow the following steps, if you want to build and run Dockerfile
1 - cd live-data-service
2 - docker-compose up -d
3 - ./mvnw clean install or mvn clean install or mvn clean package --------THIS IS MUST---------
4 - docker build -t mb/live-data-service .
5 - docker run -p 8080:8080 mb/live-data-service
- Please follow the following steps, if you want to build and run
docker-compose.yml - Remove
live-data-serviceservice comment inservicessection indocker-compose.yml Docker->Preferences->Resources->File sharing-> click add button and selectprometheusfolder under the/src/main/resourcesor just add/etc/prometheuspath ->Apply & Restart
1 - cd live-data-service
2 - ./mvnw clean install or mvn clean install or mvn clean package --------THIS IS MUST---------
3 - docker build -t mb/live-data-service .
4 - docker-compose up -d
-
The following command returns all matched data by
'keyPattern:*'patternredis-cli --scan --pattern 'keyPattern:*'
-
The following command deletes all matched data by
'keyPattern:*'patternredis-cli KEYS 'keyPattern:*' | xargs redis-cli DEL
-
The following command finds
TYPEin redis withKEYTYPE key->TYPE xxx:hashedIdOrSomethingElse
-
The following commands search by
TYPE- for
"string" TYPE:get key - for
"hash" TYPE:hgetall key - for
"list" TYPE:lrange key 0 -1 - for
"set" TYPE:smembers key - for
"zset" TYPE:zrange key 0 -1 withScores
- for
-
RedisInsight: http://localhost:8001/
- Setup Firebase or Just follow the following steps
to Initialize the SDK, Create and Download Firebase Credentials JSON File
- After JSON file is downloaded, copy the content of downloaded file and replace
play-integrity-credentials.jsoncontent with that copied text - Replace
application-namevalue in application.yml file withproject_idvariable that is inplay-integrity-credentials.json - HELPFUL LINK BUT IT SHOULD NOT BE NEEDED
- After JSON file is downloaded, copy the content of downloaded file and replace
- Metrics Made Easy Via Spring Actuator, Docker, Prometheus, and Grafana
- https://prometheus.io/docs/prometheus/latest/installation/#volumes-bind-mount
- Spring Boot Rest Controller Unit Test with @WebMvcTest
- Redis Commands
- Running RedisInsight using Docker Compose
- Google Play Integrity API
- A Guide to Querydsl with JPA

