Open KallieLev opened 1 year ago
Faust doesn't support this feature yet. I need to work on https://github.com/faust-streaming/faust/issues/429 before addressing this.
@KallieLev
Not sure if my workaround fits your need.
I have a topic with multiple Events inspired by faust.Schema 'AutoDetect' example. The customised faust.Schema is assigned to my agent subscribed to the topic.
In practice, I have a MutableMapping that stores event class name as key and class codec as value.
I use the message header to store the class name when the message are being produced.
When the message arrive to the agent, it extract the class name from the message header and consequently match the relevant codec then dynamically generate a serializer on the fly.
I want to be able to process 1 event that can have multiple schemas based on type. for example
And when I process the event, I want it to automatically be parsed by the type, and validated against the leaf class (AKA
CreateTableEvent
orInsertDataEvent
).Is this feasible? how would I write
PolyEvent
in that case?Checklist
master
branch of Faust.Versions
3.11.0
0.10.3