Yes, I realised that too. In fact, if the response version is <3, then the
size will be INT32. However, how would Wireshark know what version of
response was sent?

On Sun, Oct 27, 2024 at 10:18 PM Chia-Ping Tsai <[email protected]> wrote:

> hi Chain
>
> > ? - 1 byte value 0x3c
>
> This magic byte represents the size of the following 'Array of API keys.'
> We need to know the size of the array to determine how many elements must
> be read from the network.
>
> Here's a snippet demonstrating how the size is used.
> ```
>
> int arrayLength = _readable.readUnsignedVarint() - 1;
>
> ApiVersionCollection newCollection = new ApiVersionCollection(arrayLength);
>
> for (int i = 0; i < arrayLength; i++) {
>
> newCollection.add(new ApiVersion(_readable, _version));
>
> }
>
> this.apiKeys = newCollection;
>
> ```
> Best,
> Chia-Ping
>
> Chain Head <[email protected]> 於 2024年10月28日 週一 上午12:20寫道:
>
> > Hello,
> > I set-up a simple Java client to publish a sample message to Kafka
> broker.
> > I can see API Versions request v3 and response messages. I am able to map
> > all the bytes as described here (
> > https://kafka.apache.org/protocol.html#The_Messages_ApiVersions) for API
> > Versions request and response except for 1 byte as shown below.
> >
> > - Length - INT32
> > - Correlation ID - INT32
> > - Error code - INT16
> > - ? - 1 byte value 0x3c
> > - Array of API keys, supported versions and tagged fields
> > - Throttle - INT32
> > - Tagged fields.
> >
> > Can you please help me understand?
> >
> > Thanks.
> >
>

Reply via email to