Content Encodings¶
Compress event payloads before sending to a destination.
Overview¶
Content encodings apply compression to the serialized event body. They're optional — without a content encoding, the payload is sent uncompressed.
Content encoding runs after serialization but before content transfer encoding.
Supported Destinations¶
Encodings are applied by the destinations that carry an opaque payload over HTTP-style or SDK transports: http, soap, grpc, aws-eventbridge, aws-sns, aws-sqs, azure-eventgrid, azure-storage-queue, azure-webpubsub and gcp-cloud-tasks. All other destinations accept the property but do not apply it (the payload is sent unencoded).
Available Content Encodings¶
| Encoding | Config | Algorithm |
|---|---|---|
| Gzip | gzip |
RFC 1952 (GZIP) |
| Deflate | deflate |
RFC 1951 (DEFLATE) |
Quick Examples¶
Gzip compression:
Deflate compression:
Processing Order¶
The encoding pipeline runs in this order:
- Serialization — event → bytes (e.g., JSON, Protobuf)
- Content Encoding — compress bytes (e.g., gzip)
- Content Transfer Encoding — encode bytes (e.g., base64)
See Also¶
- Serializers — format events before encoding
- Content Transfer Encodings — encode after compression
- Destinations — where events are sent