🏞️ STREAMING DATA ONLY: Stop Kafka Service¶
Stop Apache Kafka when you are done working.
WHY?
Apache Kafka should be stopped when the streaming work session is finished. Stopping Kafka gracefully gives the local broker service time to shut down cleanly instead of being interrupted suddenly. A clean shutdown helps avoid leftover terminal processes, locked files, or confusing errors the next time Kafka is started. Even though Kafka usually stops when the VS Code terminal is closed, stopping it intentionally is a good professional habit when working with local services.When¶
- Whenever you are done working on a project that uses the Kafka message broker service.
Stop Kafka With CTRL+c¶
Kafka runs in the foreground in the terminal where you started it. Go to the terminal where Kafka is running (WSL if Windows user).
Press CTRL key and c key together (CTRL+c).
Wait for the command prompt to return.
Next Work Session¶
The next time you work on this project:
- Follow the start-kafka process.
- Leave the Kafka terminal open.
- Run the Python producer and consumer from Python.
Important¶
You only need to run install-kafka once per machine.
Use start-kafka each time you begin working.
Use stop-kafka when you finish a work session.