- 📖 This AWS Full-Stack Developer Template provides fully functional Development Environment
- 📖 Spring Boot Microservices Source Code
- 📖 Local Docker Environment
- 📖 Github Actions CI/CD GitOps pipeline
- 📖 AWS Terraform Infrastructure with AWS EKS Kubernetes Cluster
- 📖 Full Technology Stack:
- ✅ Swagger UI
- ✅ Spring Boot
- ✅ Terraform
- ✅ Kubernetes
- ✅ Kafka Streams
- ✅ Twitter to Kafka Event Streaming
- ✅ Kafka State Store
- ✅ Elasticsearch
- ✅ Elastic Query Service
- ✅ Kafka UI
- ✅ Event-Driven Microservices
- ✅ CQRS
- ✅ PostgreSQL Database
- ✅ Keycloak Oauth2 Authorization Server
- ✅ Github Actions
- ✅ Local Docker Environment
- ✅ Remote Debugging
- ✅ Spring Cloud Gateway
- ✅ AWS SSL Certificate
- ✅ External DNS
- ✅ AWS Load Balancer Controller
- ✅ Spring Cloud Kubernetes
- ✅ Grafana Observability Stack
sh docker-start.sh
-
this script will build kafka, elastic and other third-party docker images and start environment with your code changes
-
Warning! Make sure that all kafka containers are started successfully! (see
Kafka Containers Troubleshootingbelow)
sh docker-app-start.sh
-
this script will build spring boot docker images and start environment with your code changes
-
Warning! Make sure that all kafka containers are started successfully, before running this script! (see
Kafka Containers Troubleshootingbelow)
sh docker-app-restart.sh
-
this script will restart spring boot docker images without rebuilding them (use
sh docker-app-start.shif you want to rebuild docker images after code changes) -
For example, if
kafka-to-elastic-servicestops with errors, runsh docker-app-restartto restart all spring boot containers (or usedocker-compose -f docker-app-compose.yml up -dif you don't want to restart all spring boot containers)
-
If
twitter-to-kafkaservice starts successfully, it will start generating mock twitter messages and add them to Kafkatwitter-topic -
If
kafka-to-elasticservice starts successfully, it will consume messages from Kafkatwitter-topicand add them toElasticsearchindexed documents (see the docker logs) -
If
kafka-streamsservice starts successfully, it will consume messages from Kafkatwitter-topicand add them to Kafkatwitter-analytics-topic -
If
analyticsservice starts successfully, it will consume messages from Kafkatwitter-analytics-topicand insert records totwitter-analyticsPostgreSQL Table -
open
localhost:9000in your Browser and switch betweenAnalytics,Elastic QueryandKafka StreamsMicroservices -
Warning! If Swagger UI fails to load on the first try, please, refresh the page!
-
Warning! Sometimes switching between services doesn't refresh Swagger UI completely and you might see wrong REST endpoints: just refresh the page and continue
-
Warning! Sometimes REST endpoints return
504 Gateway Timeout,405 Method not Allowedor other errors, just retry the REST API endpoint again -
find word count for any word on
Analyticspage (see the list of words inMockKafkaStreamRunner) -
find word count for any word on
Kafka Streamspage (see the list of words inMockKafkaStreamRunner) -
find all documents or document by id on
Elastic Querypage -
click
AuthorizeonElastic Querypage and useadmin/adminoruser/userfor credentials (clientIdshould betwitter-app) -
search documents by text using
get-document-by-textendpoint. It will return all documents containing the Text + Word Count for this Text. (see the list of text words inMockKafkaStreamRunner) -
Congratulations! You successfuly tested
Twitter AnalyticsMicroservices with CQRS! -
See this README file for AWS Infrastructure Setup: https://github.com/greeta-twitter-01/twitter-infra
- if you want to debug your AWS kubernetes services remotely, use port forwarding:
kubectl port-forward 8002:8002
- Check containers in the following order:
Kafka Server (cp-server)Init Kafka (cp-kafka): container should finish creation of kafka topics successfully and then exitSchema Registry (cp-schema-registry)- If everything is sussessful, containers
cp-serverandcp-schema-registryshould be running without errors and containercp-kafkashould finish its job and exit without errors. - if any of the containers has exited with errors, run
docker-compose up -dagain - if any of the containers stopped responding (check the logs), remove container (docker stop, docker rm ) and run
docker-compose up -dagain
