Closed bipthelin closed 1 year ago
Reading the code it seems that I was naive in thinking that from_structured
would deserialize directly from an AIOKafka ConsumerRecord
. But instead I need to do something like this:
kafka_msg = KafkaMessage(headers=dict(msg.headers), key=msg.key, value=msg.value)
event = from_structured(kafka_msg)
this works as expected. Closing issue.
Thx for raising and resolving the issue :smile:
Yes, the connector is generic and does not provide support for a specific library. This is intentional behavior. We may wanna add extras that provide library-specific API like we did with Pydantic.
Expected Behavior
from_structured/1
on a KafkaMessage i.e.ConsumerRecord
inaiokafka
correctly deserialize the event into a CloudEvent.Actual Behavior
Crash:
Steps to Reproduce the Problem
There seems to be a discrepancy between:
Specifications