title: Streaming messages to multiple topics
body: <p>I have a single master topic and multiple predicates each of which has an output topic associated with it. I want to send each record to ALL topics that whose predicate resolves to true. I am using Luwak to test which predicates a record satisfies (to use this library you evaluate a document with a list of predicates and it tells you which ones matched - i.e. I only call it once to get the list of satisfied predicates).</p>
  
  <p>I am trying to use Kafka Streams for this but there doesn't seem to be the appropriate method on KStream (KStream#branch only routes a record to a single topic).</p>
  
  <p>One possible approach is as follows:</p>
  
  <pre><code>Stream from master
  Map the values into a format with the original content and the list of matching predicates
  Stream to an intermediate with-matches topic
  
  For each predicate/output topic
      Stream from intermediate with-matches topic
      Filter "does list of matches predicates contain predicate ID"
      Map the values to just the original content
      Stream to corresponding output topic
  </code></pre>
  
  <p>Such an intermediate topic seems "clunky" though. Any better suggestions?</p>
  
  <p>I am using:</p>
  
  <ul>
  <li>Kafka v0.10.1.1</li>
  <li>Luwak v1.4.0</li>
  </ul>