Program Streams Payload Formats
Choose JSON or protobuf payloads for decoded program streams.
Program Streams support JSON and protobuf payloads.
JSON
Set:
format = JSON;The response payload field contains JSON text.
event = json.loads(message.payload)Use JSON for:
- Initial integration
- Logs and inspection
- Dynamic consumers
- Low event volume
Protobuf
Set:
format = PROTO;The response payload field contains base64 text for the encoded protobuf message.
import base64 raw = base64.b64decode(message.payload)event = PayloadMessage()event.ParseFromString(raw)Fetch PayloadMessage and its proto through GetTopicSchema.
Use protobuf for:
- Lower parsing overhead
- Strong field types
- High event volume
- Stable generated clients
Important difference
Enhanced Streams expose payload as protobuf bytes.
Program Streams expose payload as protobuf string.
Only Program Streams PROTO output needs base64 decoding.