THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
public class KafkaStreams {
/**
* Initializes broker-side state.
*
* If some but not all of the internal topics are absent it throws an exception.
*/
public void init();
/**
* Initializes broker-side state.
*
* This methods takes parameters that specify which internal topics to setup if some
* but not all of them are absent.
*/
public void init(final InitParameters initParameters);
public class InitParameters {
public static InitParameters initParameters(); // specifies to disable all setup of internal topics
public InitParameters enableSetupRepartitionTopicsIfIncomplete(); // specifies to setup repartition topics if some are missing
public InitParameters disableSetupRepartitionTopicsIfIncomplete(); // specifies to throw if some but not all repartition topics are missing
public boolean setupRepartitionTopicsIfIncompleteEnabled(); // getter
public InitParameters enableSetupChangelogTopicsIfIncomplete(); // specifies to setup changelog topics if some are missing
public InitParameters disableSetupChangelogTopicsIfIncomplete(); // specifies to throw if some but not all changelog topics are missing
public boolean setupChangelogTopicsIfIncompleteEnabled(); // getter
public InitParameters enableSetupInternalTopicsIfIncomplete(); // specifies to setup repartition and changelog topics if some are missing
public InitParameters disableSetupInternalTopicsIfIncomplete(); // specifies to throw if some but not all repartition or changelog topics are missing
public boolean setupInternalTopicsIfIncompleteEnabled(); // getter
}
} |
...
- does not find any internal topic for the Kafka Streams client on the brokers, it will setup all internal topics
- finds all internal topics for the Kafka Streams client on the brokers, it will not setup any internal topicsleave everything as it is
- finds some of the internal topics it will
- throw
MissingInternalTopicsException
ifKafkaStreams#
init()
is called without any parameters or the parameters specify to throw for the in case of missing internal topics - setup the missing internal topics if the parameters passed to
KafkaStreams#
init()
specify so
- throw
For example, if a changelog or repartition topic is missing and init(initParameters.enableSetupChangelogTopicsIfIncompleteenableSetupInternalTopicsIfIncomplete())
is called, the missing changelog topic will be setup. However, on a missing repartition topic the same call will throw. If KafkaStreams#
init()
is called, the call will throw if an internal topic is missing and other internal topics are not missing.
...