use of io.kestra.runner.kafka.streams.GlobalInMemoryStateProcessor in project kestra by kestra-io.
the class ExecutorStore method topology.
public StreamsBuilder topology() {
StreamsBuilder builder = new KafkaStreamsBuilder();
builder.addGlobalStore(Stores.keyValueStoreBuilder(Stores.persistentKeyValueStore(FLOW_STATE_STORE_NAME), Serdes.String(), JsonSerde.of(Flow.class)), kafkaAdminService.getTopicName(Flow.class), Consumed.with(Serdes.String(), JsonSerde.of(Flow.class)).withName("GlobalStore.Flow"), () -> new GlobalInMemoryStateProcessor<>(FLOW_STATE_STORE_NAME, flows -> kafkaFlowExecutor.setFlows(flows), store -> kafkaFlowExecutor.setStore(store)));
builder.addGlobalStore(Stores.keyValueStoreBuilder(Stores.persistentKeyValueStore(TEMPLATE_STATE_STORE_NAME), Serdes.String(), JsonSerde.of(Template.class)), kafkaAdminService.getTopicName(Template.class), Consumed.with(Serdes.String(), JsonSerde.of(Template.class)).withName("GlobalStore.Template"), () -> new GlobalInMemoryStateProcessor<>(TEMPLATE_STATE_STORE_NAME, templates -> kafkaTemplateExecutor.setTemplates(templates)));
return builder;
}
Aggregations