I have an input stream:
KStream<String, X> inputStream = ...
That I would like to operate on (filter then aggregate) in such a way that I output into a GlobalKTable<String, Y> which I can then read back in using:
KeyValueIterator<String, Y> = streams.store("y-global-store", QueryableStoreTypes.keyValueStore()).all()
Can the Streams DSL support this? It seems it would be possible if the output table was a KTable, but given the small amount of data I will have in this store I'd like to use a GlobalKTable
Here is my processor which converts a KStream<String, X> to a KTable<String, Y>
KTable<String, Y> outputTable = inputStream
.filter(...)
.groupByKey(Grouped.with(Serdes.String(), ySerde))
.aggregate(
initializeWithNull(),
aggregateXToAY(),
Materialized.`as`<String, Y, KeyValueStore<Bytes, ByteArray>>("y-global-store")
.withKeySerde(stringSerde)
.withValueSerde(tagRecordSerde)
)
However this doesn't create a GlobalKTable, what am I missing?