Open big-andy-coates opened 2 years ago
Thoughts...
Should be enough to:
Store
internal resource meta type.topic
method to the streams extension that takes the stores, works out the topic name, and returns a KafkaTopic
.Boom!
Makes sense to have a common
KafkaResource
base type for topic and store, used to determine if Kafka broker should be started in tests.
Store
type wouldn't be auto created. Can't be used as input/output, as topic make isn't fix.
Need way of getting serde for state stores (and re-partition topics)
Persisted store changelog topic names are prefixed with the application.id. This means the resource descriptor, which doesn't know the application id, can't define the topic name.
Two approaches spring to mind:
KafkaStateStore
resource type, which takes the store name, rather than the topic name. Can build the topic name, given the application id. Will also need to know if its persisted or not (i.e. is there a changelog topic or not), and also needs to support windowing"${APPLICATION.ID}-my-first-store-changelog"
, where the actual topic name is determined by doing a search and replace with the actual app id.Of these, the first is more work, but is a more fully formed solution. The latter is more of a hack. Maybe.
Random thoughts on the
KafkaStateStore
solution:toOutput
method that builds an owned, but not auto-created, output topic. The idea being that if a user does want to use this weirdly named changelog topic, then in their service descriptor they define the internal store and build an output topic descriptor for it too. Question: how to handle the application id requirement in the output topic? Maybe normal topics DO need so support application ids....Materialized
is correctly configured with retention...related Kafka issue for removing the need for duplicate changelog topics: https://issues.apache.org/jira/browse/KAFKA-6035
Tutorial should cover different store types. For example, could extend filter service to read whitelist from topic into global store (with global store impl provided by creek?), add scoreboard service with hourly, daily windowed stores and unwindowed version using retention settings only.