public void setStateListener(final StreamThread.StateListener listener) {
        stateListener = listener;
    }
Set the {@link StreamThread.StateListener} to be notified when state changes. Note this API is internal to
Kafka Streams and is not intended to be used by an external application.
streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStreamThread.java