I'm trying to build the Materialized.as DSL code here: https://kafka.apache.org/11/javadoc/org/apache/kafka/streams/state/Stores.html
But I'm getting the error
incompatible types: org.apache.kafka.common.serialization.Serde<java.lang.Long> cannot be converted to org.apache.kafka.common.serialization.Serde<java.lang.Object>
On the line
.withKeySerde(Serdes.Long())
Does anyone know what might be wrong here?
final StreamsBuilder builder = new StreamsBuilder();
KeyValueBytesStoreSupplier storeSupplier = Stores.inMemoryKeyValueStore("mystore");
KTable<Long,String> dataStore = builder.table(
"example_stream",
Materialized.as(storeSupplier)
.withKeySerde(Serdes.Long())
.withValueSerde(Serdes.String()));
builder
definition, and all other code thatbuilder
uses – OneCricketeer