tisonkun / kafka-api

Generic abstractions for Kafka API.
https://crates.io/crates/kafka-api
Apache License 2.0
14 stars 2 forks source link

Two types of nullable bytes #6

Closed aovestdipaperino closed 4 weeks ago

aovestdipaperino commented 3 months ago

I just realized that there are two ways to encode nullable bytes (or bytes array). For some messages the length is either varint or int16 (which is what is currently implemented) For some other messages (JoinGroupResponse, JoinGroupRequest, SyncGroupResponse) it's not an int16 but an int32. This is not documented in the protocol unfortunately. :(

tisonkun commented 4 weeks ago

Closed as the development has been moved to Morax under api/kafka-api.

The issue seems related to a bug in the kafka-api early version. The Kafka official protocol define these type of length: https://kafka.apache.org/protocol.html#protocol_types

image