Search code examples
apache-kafkaapache-kafka-streams

How to Convert the Simple Integer Key of a Kafka Stream to a Complex Avro Type Key


I have a streaming app topology which consumes from a simple topic with an Integer key and an AVRO body. I would like to manipulate the stream and write to a topic with a complex AVRO key. But I can't find the the "key" equivalent to mapValues(). In other words, I seem to be stuck with the original Integer key. Can I convert this?


Solution

  • The "equivalent" is just map(). You would return the value in the KeyValuePair type as unmodified.