You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Status

Current stateUnder Discussion

Discussion thread: here 

JIRA: here or here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently there is not a native way to shutdown and entire KStreams application from a StreamThread. This functionality would be useful for immediately halting processing to prevent data from being corrupted. This would help recover form errors such as a source topic deleted.

Public Interfaces

/**
 * Should be thrown in reaction to an event that necessitates the closure of the entire Streams application.
 *
 */
public class ShutdownRequestedException extends StreamsException {
    
    public ShutdownRequestedException(final String message) {
        super(message);
    }

    public ShutdownRequestedException(final String message, final Throwable throwable) {
        super(message, throwable);
    }

    public ShutdownRequestedException(final Throwable throwable) {
        super(throwable);
    }
}


Proposed Changes

We propose to add a new exception that will cause all clients in the application to be shutdown when thrown.

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.

Compatibility, Deprecation, and Migration Plan

The SubcriptionInfoData will be upgraded to version 8 because we are adding a feild for an error code to be propgated through the application.

No methods need to be deprecated.

Rejected Alternatives

None

  • No labels