- DOCKER Desktop installed.
docker-compose up -d
→ Start Docker composition.docker-compose down
→ Stop Docker composition (useful for restarts).docker ps
→ View information about running containers in Docker.
-
Run Kafka
Execute the following command in the terminal from the root Shop folder (wheredocker-compose.yml
is located):"docker-compose up -d"
-
Get Kafka Container ID
Use the following command to retrieve the Kafka container ID:"docker ps"
Alternatively, you can view the container in Docker Desktop.
-
Create Kafka Topic: PAYMENTS
Run the following command to create thepayments
topic in Kafka, replace kafka-container-id:"docker exec -it kafka-container-id kafka-topics --create \ --topic payments --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1"
You can start the desired containers directly in Docker Desktop.