Dede
Dede

Reputation: 1640

Apache Kafka : Processor generates multiple output per input

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.

Upvotes: 1

Views: 385

Answers (1)

Matthias J. Sax
Matthias J. Sax

Reputation: 62285

For Processor API, context.forward(key, item) is correct.

For DSL, you could also use KStream#flatMapValues() or KStream()flatMap().

Upvotes: 2

Related Questions