When building a Kafka Streams topology, reads from multiple topics can be modeled in two different ways:
- Read all topics with the same source node.
topologyBuilder.addSource("sourceName", ..., "topic1", "topic2", "topic3");
- Read each topic using a separate source node.
topologyBuilder.addSource("sourceName1", ..., "topic1")
.addSource("sourceName2", ..., "topic2")
.addSource("sourceName3", ..., "topic3");
Is there a relative advantage of option1 over option2 or vice versa? All topics contain the same type of data and have the same data processing logic.