While the current implementation of the from_dict in cloud event is round trippable, the from_dict does not work with known services.
In other words, this should not break:
with event_hub_client:
with receiver:
for msg in receiver:
batch = event_hub_client.create_batch()
batch.add(EventData(f"Receiving messages..."))
event = CloudEvent.from_dict(
json.loads(str(msg))
)
While the current implementation of the
from_dictin cloud event is round trippable, thefrom_dictdoes not work with known services.In other words, this should not break: