Stopping a Consumer
Explore how to properly stop a Kafka consumer running in an infinite poll loop by using the wakeup() method to safely interrupt polling and close() to commit offsets. Understand how to implement a shutdown hook for consumers in the main thread to ensure graceful shutdown and prompt broker rebalancing.
We'll cover the following...
We'll cover the following...
In the previous lessons, we showed code for the Kafka consumer that ran an infinite poll loop. This ...