Class StreamsRunner

java.lang.Object
com.bakdata.kafka.streams.StreamsRunner
All Implemented Interfaces:
Runner, AutoCloseable, Runnable

public final class StreamsRunner extends Object implements Runner
Runs a Kafka Streams application
  • Constructor Details

    • StreamsRunner

      public StreamsRunner(@NonNull @NonNull org.apache.kafka.streams.Topology topology, @NonNull @NonNull org.apache.kafka.streams.StreamsConfig config)
      Create a StreamsRunner with default StreamsExecutionOptions
      Parameters:
      topology - topology to be executed
      config - streams configuration
    • StreamsRunner

      public StreamsRunner(@NonNull @NonNull org.apache.kafka.streams.Topology topology, @NonNull @NonNull org.apache.kafka.streams.StreamsConfig config, @NonNull @NonNull StreamsExecutionOptions options)
      Create a StreamsRunner
      Parameters:
      topology - topology to be executed
      config - streams configuration
      options - options to customize KafkaStreams behavior
  • Method Details

    • run

      public void run()
      Run the Streams application. This method blocks until Kafka Streams has completed shutdown, either because it caught an error or close() has been called.
      Specified by:
      run in interface Runnable
      Specified by:
      run in interface Runner
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Runner