Example of Apache Kafka usage with Spring Boot.
Used Docker to containerize environment.
- Uses SSL authentication
- 3 instances running
- Make sure you have
Docker
anddocker-compose
installed.
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
kafka
in those fields:Common Name
,first and last name
. Also, use the same password every time when asked. - Replace generated
kafka.keystore
andkafka.trustore
with the old ones incertificates
. - Change password in
certificates/trustore_creds
,certificates/keystore_creds
,certificates/sslkey_creds