Example of Apache Kafka usage with Spring Boot.
Used Docker to containerize environment.
- Uses SSL authentication
- 3 instances running
- Make sure you have
Dockeranddocker-composeinstalled.
Docker CE INSTALLATION
Docker Compose INSTALLATION
- Build services:
docker-compose build - Run services:
docker-compose up - Request book-service:
curl --location --request POST 'localhost:6060/book/buy' --header 'Content-Type: application/json' --data-raw '{
"accountId": 1,
"bookId": 2,
"deliveryDetails": {
"street": "abc",
"houseNumber": "123",
"zipCode": "123456",
"country": "ABC",
"region": "CBA"
}
}'
- Download script.
- Run it and type
kafkain those fields:Common Name,first and last name. Also, use the same password every time when asked. - Replace generated
kafka.keystoreandkafka.trustorewith the old ones incertificates. - Change password in
certificates/trustore_creds,certificates/keystore_creds,certificates/sslkey_creds
