Kafka - How to use filter and filternot at the same time?
<p>I have a Kafka stream that takes data from a topic, and needs to filter that information to two different topics.</p>

<pre><code>KStream&lt;String, Model&gt; stream = builder.stream(Serdes.String(), specificAvroSerde, "not-filtered-topic");
stream.filter((key, value) -&gt; new Processor().test(key, value)).to(Serdes.String(), specificAvroSerde, "good-topic");
stream.filterNot((key, value) -&gt; new Processor().test(key, value)).to(Serdes.String(), specificAvroSerde, "bad-topic");
</code></pre>

<p>However, when I do it like this, it reads the data from the topic twice -- not sure if that has any impact on performance as the data gets larger. Is there a way to just filter it once and push it to two topics?</p>