Given lots of protocol changes in 0.10 compared to 0.9, with many API methods now having up to 3 possible versions, what is the suggested way for the client library to coordinate with Kafka brokers? I can see there is ApiVersions request which is great, but what happens if Kafka cluster consists of mixed 0.9 and 0.10 brokers (for example during upgrade), should the library keep and refresh the state of supported APIs for each broker the same way it does for topic metadata? Another example is the Metadata request (Api Key 3) which has two versions, how would the client library in the first place know which version of the request to send to each of the initial brokers?
I can't see an easy way for the client library to support for example both 0.9 and 0.10 without complicated state switches and error handling. I'm not talking about official Java client, but about other language libraries. What would you suggest? Thanks!