Versions Compared

Key

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

...

Code Block
languagejava
/**
     * Attempts to shutdown an application.
     * If there is an alive StreamThread it will succeed, if there is not it will fail
     *
     * @return Will return true if shutdown is initiated false if it is not possible.
     */
    public boolean shutdownApplicationinitiateClosingAllClients();


Proposed Changes

We propose to add a new method that will cause all clients in the application to be shutdown when called. We achieve this adding shutdownApplication initiateClosingAllClients to `KafkaStreams.java`  which will search for an alive stream thread to start the shutdown. If there is not an alive shutdown thread the method will return false indicating that the shutdown was not initiated. The method will be non-blocking but will stop the alive thread it found from processing.

In order to communicate the shutdown request from one client to the others we propose to update the SubcriptionInfoData to include a short field which will encode an error code. The error will be propagated through the metadata during a rejoin event via the assignor. The actual shutdown will be handled by the StreamsRebalnceListener, this is where the INCOMPLETE_SOURCE_TOPIC_METADATA error can also be handled.

...