You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python Kafka structured JSON emits data_base64 instead of data #713
Generated Python Kafka producers serialize JSON into bytes before constructing the CloudEvent. In structured mode, the SDK consequently emits data_base64 for datacontenttype=application/json rather than embedding the JSON value as data.
Reproducer: generate a Python kafkaproducer for the existing versioned Reading fixture, create the generated Reading with value="live", construct the producer with content_mode="structured" and capture the produce(value=...) argument. json.loads(value)["data"] raises KeyError; the envelope contains data_base64.
Four source-level regression cases exposed this during Pegelonline regeneration: both event families, with and without dataschema overrides. The SDK can round-trip the base64 envelope, so consumer round-trip checks alone miss the binding error.
Correction: decode JSON and +json payload bytes before structured formatting, use an identity data marshaller, and retain raw binary bytes for non-JSON media types. Verify both JSON embedding and raw Avro base64 encoding in generated-runtime tests.
Activity
Embed JSON values in structured Kafka CloudEvents
clemensv commentedon Nov 24, 2026
Duplicate of #701, discovered during regeneration. The same fix and regression proof are included in #712; tracking remains in #701.