Class KrabkaStreamsConfig
java.lang.Object
io.krabka.streams.KrabkaStreamsConfig
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertieswithDefaults(Map<?, ?> settings) Copies the supplied settings and adds krabka defaults.
-
Field Details
-
GROUP_PROTOCOL_CONFIG
The Kafka client configuration key that selects the group protocol.- See Also:
-
STREAMS_GROUP_PROTOCOL
Thegroup.protocolvalue that enables the streams group protocol.- See Also:
-
-
Method Details
-
withDefaults
Copies the supplied settings and adds krabka defaults. Explicit settings keep their values.Currently the only default is
GROUP_PROTOCOL_CONFIGset toSTREAMS_GROUP_PROTOCOL. The supplied map is not modified.- Parameters:
settings- source settings, typically keyed byStreamsConfigconstants- Returns:
- an independent properties object
- Throws:
NullPointerException- ifsettingsis null
-