travisjeffery / jocko

Kafka implemented in Golang with built-in coordination (No ZK dep, single binary install, Cloud Native)
https://twitter.com/travisjeffery
MIT License
4.94k stars 363 forks source link

Reject unknown API versions #139

Open candlerb opened 6 years ago

candlerb commented 6 years ago

According to the protocol document, brokers are supposed to reject messages containing a higher API version than they understand. This is important because the encoded response does not contain the API version used.

Jocko declares to the client which API versions it supports (defined in protocol/api_versions.go). But I can't see whether it enforces this in incoming requests, and I think it should. It would just be a question of checking the received API version (second field in Request Header) against the min/max values in protocol.APIVersions