title: KStreams with multi event types topic
body: <p>I'm struggling with Kafka and its multi-event types per topic concept. According to this <a href="https://confluent.io/blog/put-several-event-types-kafka-topic/" rel="nofollow noreferrer">article</a>, there are some cases when it's fine to keep events of different types in single topic. And I believe I have all prerequisites to use it my case. Without going deep into the idea, I just tell that I want to keep commands and events in same topic under the same key to preserve order of the events.</p>
  
  <p>In my case I'm using avro and would like to use <code>io.confluent.kafka.serializers.subject.RecordNameStrategy</code> for serialisation of events coming from topic. And I would like to use Kafka Streams api to avoid low-level api. Thus, KStream is a java class which designed to heavily use generics and type parameter, I'm not sure the right way to express the nature of such polymorf topic nature with it, as I'm using Avro records and autogenerated classes, where I cannot build inheritance tree of objects or use composition to encapsulate such playload inside some wrapper class. </p>
  
  <p>If I will use Object class in the KStream definition and will allow schemaregistry to convert data, and then apply filtering by type, does not looks right to me... </p>
  
  <p>I also thought about defining different consumer for same topic which are supposed to read events only of right type, but also don't have an glue how to filter such, before reaching up my KStream...</p>
  
  <p><strong>And here is my question. What would be the right way of archiving this with KStream ?</strong></p>
  
  <p>I will appreciate any help or ideas</p>
  
  <p>Thanks! </p>