Tutorial - Event-Driven Microservices: Spring Boot, Kafka and Elastic - from Ali Gelenler (Udemy)
- Start kafka cluster
docker-compose -f common.yml -f kafka_cluster.yml up
- Kafkacat command line
docker run --tty --network host confluentinc/cp-kafkacat kafkacat -b localhost:29092 -L
-L
- list-b
- brokers- Kafkacat docker commands
- Kafkacat as consumer
docker run --rm --tty --network host confluentinc/cp-kafkacat kafkacat -b localhost:29092 -C -t twitter-topic
docker container ls -a --filter ancestor=confluentinc/cp-kafkacat
- list useless containersdocker container rm $(docker container ls -a --filter ancestor=confluentinc/cp-kafkacat -q)
- remove all containers by image name
- Create private repository
art-gelenler-event-driven-config-repo
- Create github access token
- Settings -> Developer settings -> Personal Access Tokens -> Create new
- Select scopes:
repo
- Generate token
- Copy token
- Create environment variable
GITHUB_ACCESS_TOKEN = {Paste token here}
- Use
separate-remote-git-repo
spring profile to start application
- Install SDKMAN (I used WSL Ubuntu in Windows)
- Install Spring Boot
sdk install springboot
- Check installations
ls ~/.sdkman/candidates/
cd ~/.sdkman/candidates/springboot
- Install Spring Cloud CLI
spring install org.springframework.cloud:spring-cloud-cli:3.1.1
- Encrypt password
spring encrypt PLAIN_TEXT --key KEY
- Set ENCRYPT_KEY through Environment variable
- Start elastic cluster
docker-compose -f common.yml -f elastic_cluster.yml up
- In case of error in Windows
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
- use commands for Windows
wsl -d docker-desktop
sysctl -w vm.max_map_count=262144
- or permanently add
vm.max_map_count = 262144
to /etc/sysctl.conf
ENCRYPT_KEY must be provided through System Environment Variables
- Infrastructure (without microservices)
docker-compose up -d
docker-compose --profile=debug up -d
(with adminer, kibana)
- Full stack
docker-compose --profile=app up -d