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
`HttpBinding.default` returns a singleton with `JsonFormat` and `TextFormat` pre-registered. Custom formatters are registered via `register_formatter`.
61
61
62
+
### Kafka Binding (`KafkaBinding`)
63
+
64
+
Handles encoding/decoding CloudEvents to/from Kafka messages. CloudEvents 1.0 only (no V0.3). Supports:
65
+
-**Binary content mode** — event attributes as `ce_*` headers (plain UTF-8, no percent-encoding), data in value
66
+
-**Structured content mode** — entire event serialized in value (e.g., JSON)
67
+
-**No batch mode** (per the Kafka spec)
68
+
-**Tombstone support** — `nil` value represents an event with no data
69
+
-**Key mapping** — configurable callables to map between Kafka record keys and event attributes (default: `partitionkey` extension)
70
+
71
+
Kafka messages are represented as plain `{ key:, value:, headers: }` Hashes, decoupled from any specific Kafka client library.
72
+
73
+
`KafkaBinding.default` returns a singleton with `JsonFormat` and `TextFormat` pre-registered. Key mappers are configurable at construction and overridable per-call via `key_mapper:` / `reverse_key_mapper:` keyword arguments.
74
+
62
75
### Format Layer
63
76
64
77
-**`JsonFormat`** — Encodes/decodes `application/cloudevents+json` and batch format. Also handles JSON data encoding/decoding for binary mode.
@@ -77,6 +90,7 @@ All errors inherit from `CloudEventsError`: `NotCloudEventError`, `UnsupportedFo
77
90
78
91
## Contributing
79
92
93
+
- Use red-green test-driven development when making changes, unless instructed otherwise.
80
94
- Conventional Commits format required (`fix:`, `feat:`, `docs:`, etc.)
81
95
- Commits must be signed off (`git commit --signoff`)
0 commit comments