问题
Why must a global table not have logging enabled in kafka?
code:
if (loggingEnabled) {
throw new TopologyException("StateStore " + storeName + " for global table must not have logging enabled.");
}
When I am restarting my kafka application all the datastore in globalstore is getting clean. How could I can made it tolerance.
回答1:
GlobalKTable
s use their input topic to guarantee fault-tolerance. Thus, I am not sure what you mean by
When I am restarting my kafka application all the datastore in globalstore is getting clean.
As long as the input topic is correctly configured with log-compaction enabled, the GlobalKTable
state will be recreated on startup even if you delete the state locally.
Enabling logging does not make sense because each KafkaStreams
instance loads the whole GlobalKTable
data (ie, the data is broadcasted to all instances). Changelog topics are designed for shareded state though using one topic-partition per shard. Thus, both concepts don't align but contradict each other.
来源:https://stackoverflow.com/questions/52707748/why-does-kafka-streams-enforce-logging-disabled-for-globalktable-state-stores