GeezerVison is showing github.com — MINOR: Clarify non-compact fields in flexible protocol docs (#23692) · coderbruis/kafka@a81595a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: docs/design/protocol.md +3-1Lines changed: 3 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -138,7 +138,9 @@ The protocol is built out of the following primitive types. |
138 | 138 |
|
139 | 139 | {{< include-html file="/static/{version}/generated/protocol_types.html" >}} |
140 | 140 |
|
141 | | -Message versions marked as flexible use the compact encoding for variable-length fields. In particular, arrays use `COMPACT_ARRAY` rather than `ARRAY`; strings and byte arrays similarly use their corresponding `COMPACT_*` types. Compact encodings store their length as an unsigned variable-length integer instead of a fixed-width integer. Flexible versions also include a tagged-fields section at the end of every request and response component. |
| 141 | +By default, message versions marked as flexible use the compact encoding for variable-length fields. In particular, arrays use `COMPACT_ARRAY` rather than `ARRAY`; strings and byte arrays similarly use their corresponding `COMPACT_*` types. Compact encodings store their length as an unsigned variable-length integer instead of a fixed-width integer. Flexible versions also include a tagged-fields section at the end of every request and response component. |
| 142 | + |
| 143 | +Individual fields can override this encoding in the message schema. For example, `ClientId` in flexible request headers uses `NULLABLE_STRING` with a two-byte length prefix, rather than `COMPACT_NULLABLE_STRING`, so that older brokers can read the header of an `ApiVersions` request. |
142 | 144 |
|
143 | 145 | ### Notes on reading the request format grammars |
144 | 146 |
|
|