Kafka Streams API: KStream to KTable
I have a Kafka topic where I send location events (key=user_id, value=user_location). I am able to read and process it as a KStream : KStreamBuilder builder = new KStreamBuilder(); KStream<String, Location> locations = builder .stream("location_topic") .map((k, v) -> { // some processing here, omitted form clarity Location location = new Location(lat, lon); return new KeyValue<>(k, location); }); That works well, but I'd like to have a KTable with the last known position of each user. How could I do it? I am able to do it writing to and reading from an intermediate topic: // write to