Class StreamsCleanUpRunner

java.lang.Object
com.bakdata.kafka.streams.StreamsCleanUpRunner
All Implemented Interfaces:
CleanUpRunner, AutoCloseable

public final class StreamsCleanUpRunner extends Object implements CleanUpRunner
Clean up the state and artifacts of your Kafka Streams app
  • Method Details

    • create

      public static StreamsCleanUpRunner create(@NonNull @NonNull org.apache.kafka.streams.Topology topology, @NonNull @NonNull org.apache.kafka.streams.StreamsConfig streamsConfig)
      Create a new StreamsCleanUpRunner with default StreamsCleanUpConfiguration
      Parameters:
      topology - topology defining the Kafka Streams app
      streamsConfig - configuration to run topology and connect to Kafka admin tools
      Returns:
      StreamsCleanUpRunner
    • create

      public static StreamsCleanUpRunner create(@NonNull @NonNull org.apache.kafka.streams.Topology topology, @NonNull @NonNull org.apache.kafka.streams.StreamsConfig streamsConfig, @NonNull @NonNull StreamsCleanUpConfiguration configuration)
      Create a new StreamsCleanUpRunner
      Parameters:
      topology - topology defining the Kafka Streams app
      streamsConfig - configuration to run topology and connect to Kafka admin tools
      configuration - configuration for hooks that are called when running clean() and reset()
      Returns:
      StreamsCleanUpRunner
    • runResetter

      public static void runResetter(Collection<String> inputTopics, Collection<String> allTopics, StreamsConfigX streamsAppConfig)
      Parameters:
      inputTopics - list of input topics of the streams app
      allTopics - list of all topics that exists in the Kafka cluster
      streamsAppConfig - configuration properties of the streams app
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface CleanUpRunner
    • clean

      public void clean()
      Clean up your Streams app by resetting the app and deleting the output topics and consumer group.
      Specified by:
      clean in interface CleanUpRunner
      See Also:
    • reset

      public void reset()
      Clean up your Streams app by resetting all state stores, consumer group offsets, and internal topics, deleting local state.