I have a Kafka stream processor that has to take one item as input, and produces multiple item as output.
What is the right way to code it ? Are multiple calls to this.context().forward(key, item)
the right way to do it, or is there another cheat ?
Thanks.
For Processor API,
context.forward(key, item)
is correct.For DSL, you could also use
KStream#flatMapValues()
orKStream()flatMap()
.