Created
February 11, 2021 16:10
-
-
Save JorgenRingen/06b19213e2364550a5af124245cafc35 to your computer and use it in GitHub Desktop.
Set topic-config for internal changelog-topics in kafka streams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
streamsBuilder.addStateStore( | |
Stores.keyValueStoreBuilder( | |
Stores.persistentKeyValueStore("storeName"), | |
Serdes.StringSerde(), | |
JsonSerde<OrderV2>() | |
) | |
.withCachingEnabled() | |
.withLoggingEnabled( | |
mapOf( | |
RETENTION_MS_CONFIG to Duration.ofDays(30).toMillis().toString(), | |
CLEANUP_POLICY_CONFIG to "$CLEANUP_POLICY_COMPACT,$CLEANUP_POLICY_DELETE" | |
) | |
) | |
) | |
val materialized = Materialized.`as`<String, String, KeyValueStore<Bytes, ByteArray>>("storeName") | |
materialized.withLoggingEnabled( | |
mapOf( | |
RETENTION_MS_CONFIG to Duration.ofDays(30).toMillis().toString(), | |
CLEANUP_POLICY_CONFIG to "$CLEANUP_POLICY_COMPACT,$CLEANUP_POLICY_DELETE" | |
) | |
) | |
streamsBuilder.table("foo", materialized) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment