Question about vt6: List for an unknown topic

The BinSpec for the DescribeTopicPartitions Request has the client ID (compactString) as 0x00, 0x09. If I understand correctly, because compact string is a 32-bit unsignedVarInt, the leading byte, 0x00, should be omitted? Or does 32-bit mean that the smallest a varInt can be is 32-bit (2 bytes)?

0x00, 0x00, 0x00, 0x20, // message_size: 32
			0x00, 0x4b, // request_api_key: 75
			0x00, 0x00, // request_api_version: v0
			0x00, 0x00, 0x00, 0x07, // correlation_id: 7
			// client_id
            // vv here's the string I'm referring to
			0x00, 0x09, // length  9
            // ^^ should the uVarInt have the leading 0x00 byte?
			0x6b, 0x61, 0x66, 0x6b, 0x61, 0x2d, 0x63, 0x6c, 0x69, // kafka-cli
			0x00, // tag buffer

Whoops. I had the type for client ID wrong. I thought it was a NULLABLE_COMPACT_STRING, but it’s a NULLABLE_STRING which is always 2 bytes

2 Likes

Hi @harveysanders, Client ID is a NULLABLE_STRING, instead of COMPACT_STRING.

So its length N is specified by INT16 (2 bytes): 0x0009.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.