When creating the response to the client, should we consider a specific order like correlation id comes before api version ? As we are parsing the request using api_version before correlation_id, I expected the same to happen in the response side.
Please can someone clarify this point.
There is no way you can parse a binary stream and arrange the order. The order is fixed and must be known so that when you receive the stream you know what each byte represents.
Computer programs (including Kafka) that communicate over networks use protocols, which are essentially predefined rules. Unfortunately, these rules may not always align with our expectations.
Thanks for the clarification and the example @andy1li ! However wouldn’t that raise inconsistency in the way Kafka handles communications ?
I mean The protocol has a strict format and predefined rules that must be followed, otherwise, the communication would fail right ?
Thanks @lfmunoz for the response, in our case from where can I know the order that the response needs to follow, did I miss this in the task ?
As I read the documentation, the correlation id seems to come after the api_version.
Requests follow the predefined rules for requests, and responses follow the predefined rules for responses. The rules don’t necessarily have to be the same for different types of communication.
Yes, that’s correct!
Feel free to discuss any specific inconsistencies you’ve noticed.