Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. The background thread has not been constructed, so it is down.

  2. The polling thread starts the background thread; the background thread moves to the initialized state.  Usually happens after new KafkaConsumer().

  3. The background thread loop is running.  Here are the things that are happening:

    1. Poll for the new events (for example, a commit event) from the channel

    2. 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.

  4. Poll ConsumerCoordinator

  5. Poll networkClient

  6. Go Loop back to 3 if not closed.

  7. If close() is received:

    1. set close to true to that the loop and exit

    2. poll coordinator and network client

    3. Commit

...