title: Apache Kafka (KStreams) : How to subscribe to multiple topics?
body: <p><strong>I have the following code</strong></p>
  
  <pre><code>//Kafka Config setup
  Properties props = ...; //setup
  
  List&lt;String&gt; topicList = Arrays.asList({"A", "B", "C"});
  
  StreamBuilder builder = new StreamBuilder();
  KStream&lt;String, String&gt; source = builder.stream(topicList);
  
  source
  .map((k,v) -&gt; { //busy code for mapping data})
  .transformValues(new MyGenericTransformer());
  .to((k,v,r) -&gt; {//busy code for topic routing});
  
  new KafkaStream(builder.build(), properties).start();
  </code></pre>
  
  <p><strong>My Problem :</strong> When I add more than one topic to subscribe to (ie A,B,C in above) the Kstream code stops receiving records. </p>
  
  <p><strong>References :</strong> <a href="https://kafka.apache.org/10/javadoc/org/apache/kafka/streams/StreamsBuilder.html" rel="nofollow noreferrer">https://kafka.apache.org/10/javadoc/org/apache/kafka/streams/StreamsBuilder.html</a></p>
  
  <p><strong>Relevant Documentation</strong> </p>
  
  <pre><code>public &lt;K,V&gt; KStream&lt;K,V&gt; stream(java.util.Collection&lt;java.lang.String&gt; topics)
  
  "If multiple topics are specified there is no ordering guarantee for records from different topics."
  </code></pre>
  
  <p><strong>What I'm trying to achieve :</strong> Have one Kstream (ie 'source' from above) consume/process from multiple topics. </p>