Description
The KStream API provides merge(KStream) to merge another KStream with this. Sometimes, it may be useful to merge more than 2 KStreams together. Currently, the best way to do this is using Java's Stream.reduce:
List<KStream<K, V>> streams ...; streams.stream().reduce((left, right) -> left.merge(right));
This creates a merge node in the process graph for every KStream in the collection being merged.
Complex process graphs can make understanding an application and debugging more difficult, therefore, we propose a new API that creates a single merge node in the process graph, irrespective of the number of KStreams being merged:
KStream<K, V> merge(Collection<KStream<K, V>> streams); KStream<K, V> merge(Collection<K, V> streams, Named named);