Stopping a Consumer

This lesson explains how the pool loop of a Kafka consumer can be cleanly exited.

We'll cover the following...

In the previous lessons, we showed code for the Kafka consumer that ran an infinite poll loop. This brings up the question of how we can gracefully stop a consumer. The KafkaConsumer object exposes a method wakeup() that can be invoked from a different thread to stop the consumer. Note that ...