...
The background thread has not been constructed, so it is down.
The polling thread starts the background thread; the background thread moves to the initialized state. Usually happens after new KafkaConsumer().
The background thread loop is running. Here are the things that are happening:
Poll for the new events (for example, a commit event) from the channel
Check the background thread state by running the state machine. Ensure state requirements are fulfilled.
If the event requires a coordinator. Moves the background thread to the coordinator_discovery (coordinator discovery) state.
If not, stays initialized and execute the event.
Check the coordinator connection.
If the FindCoordinator request hasn’t been completed, stay in the discovery state.
If the request fails, transition to the initialized state.
Otherwise, the coordinator is found. Transition to the stable state.
Poll ConsumerCoordinator
Poll networkClient
Go Loop back to 3 if not closed.
If close() is received:
set close to true to that the loop and exit
poll coordinator and network client
Commit
...