Question about Kafka: Parse correlation Id

The solutions passes if we assume that the first two bytes of the header consists of api key.

connection.on('data',(data) => {
    const api_key = data.subarray(0, 2);
}

But, isn’t that the first 4 bytes in the header consists of size information? Why are we ignoring the size here?

the tester have not tests the header size here, acoording to the task description, it just validate the correlation id in this section.

1 Like

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

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