Class KrabkaStreamsConfig

java.lang.Object
io.krabka.streams.KrabkaStreamsConfig

public final class KrabkaStreamsConfig extends Object
Applies the client settings that a krabka streams group needs.

krabka brokers coordinate Kafka Streams applications through the streams group protocol. The only krabka-specific configuration step is to enable that protocol, which withDefaults(Map) does for you while leaving every setting you supply untouched.

Example

var settings = Map.<String, Object>of(
    StreamsConfig.APPLICATION_ID_CONFIG, "order-counter",
    StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");

var streams = new KafkaStreams(topology, KrabkaStreamsConfig.withDefaults(settings));
streams.start();

To opt out of a default, set the key explicitly; explicit settings always win:

var settings = Map.<String, Object>of(
    StreamsConfig.APPLICATION_ID_CONFIG, "order-counter",
    StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092",
    KrabkaStreamsConfig.GROUP_PROTOCOL_CONFIG, "classic");
  • Field Details

    • GROUP_PROTOCOL_CONFIG

      public static final String GROUP_PROTOCOL_CONFIG
      The Kafka client configuration key that selects the group protocol.
      See Also:
    • STREAMS_GROUP_PROTOCOL

      public static final String STREAMS_GROUP_PROTOCOL
      The group.protocol value that enables the streams group protocol.
      See Also:
  • Method Details

    • withDefaults

      public static Properties withDefaults(Map<?,?> settings)
      Copies the supplied settings and adds krabka defaults. Explicit settings keep their values.

      Currently the only default is GROUP_PROTOCOL_CONFIG set to STREAMS_GROUP_PROTOCOL. The supplied map is not modified.

      Parameters:
      settings - source settings, typically keyed by StreamsConfig constants
      Returns:
      an independent properties object
      Throws:
      NullPointerException - if settings is null