When using “topology.addProcessor” and passing two parents with compatible record keys, are records of a given key supposed to be treated by a single processor instance? Same question with “stream.merge” followed by “stream.process”.
Context
I’m learning Kafka streams and recently came to the conclusion that this should be the case following my study of the documentation and some tests. I wrote a custom processor which receives records from a topic and from the output of another processor (which is just a filter on another topic). My processor was working just fine when testing with a TopologyTestDriver but now that I’m testing the whole application (with a kafka broker), it seems multiple instances of the processor are instantiated with two of them processing the records. There are only two possible keys in this test, so I was expecting each processor instance to handle one of them for both inputs (topics). Instead, I observed that each processor instance processed one input entirely regardless of the keys.
Follow-up question
How can one implement a join node or any node with multiple inputs, if the answer to my first question is no?