Package com.bakdata.kafka
Class RuntimeConfiguration
java.lang.Object
com.bakdata.kafka.RuntimeConfiguration
Runtime configuration to connect to Kafka infrastructure, e.g., bootstrap servers and schema registry.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeConfiguration
Create a runtime configuration with the given bootstrap servers.Create Kafka properties to connect to infrastructure and modify runtime behavior.Configure arbitrary Kafka propertiesDisable for Kafka Streams.withSchemaRegistryUrl
(String schemaRegistryUrl) Configure a schema registry for (de-)serialization.withSessionTimeout
(Duration sessionTimeout) ConfigureConsumerConfig.SESSION_TIMEOUT_MS_CONFIG
for Kafka consumers.withStateDir
(Path stateDir) ConfigureStreamsConfig.STATE_DIR_CONFIG
for Kafka Streams.
-
Method Details
-
create
Create a runtime configuration with the given bootstrap servers.- Parameters:
bootstrapServers
- bootstrap servers to connect to- Returns:
- runtime configuration
-
with
Configure arbitrary Kafka properties- Parameters:
newProperties
- properties to configure- Returns:
- a copy of this runtime configuration with provided properties
-
withSchemaRegistryUrl
Configure a schema registry for (de-)serialization.- Parameters:
schemaRegistryUrl
- schema registry url- Returns:
- a copy of this runtime configuration with configured schema registry
-
withStateDir
ConfigureStreamsConfig.STATE_DIR_CONFIG
for Kafka Streams. Useful for testing- Parameters:
stateDir
- directory to use for storing Kafka Streams state- Returns:
- a copy of this runtime configuration with configured Kafka Streams state directory
-
withNoStateStoreCaching
Disable for Kafka Streams. Useful for testing- Returns:
- a copy of this runtime configuration with Kafka Streams state store caching disabled
-
withSessionTimeout
ConfigureConsumerConfig.SESSION_TIMEOUT_MS_CONFIG
for Kafka consumers. Useful for testing- Parameters:
sessionTimeout
- session timeout- Returns:
- a copy of this runtime configuration with configured consumer session timeout
-
createKafkaProperties
Create Kafka properties to connect to infrastructure and modify runtime behavior.bootstrap.servers
is always configured.- Returns:
- properties used for connecting to Kafka
-