When unsuccessfully trying to connect to a broker, there are multiple reasons of failure that all result in a NoBrokersAvailable exception.
- when specifying
someunavailabledomain.com as the bootstrap_servers the resulting exception will be NoBrokersAvailable (which is intuitive)
- when not specifying an
api_version, the resulting exception will also be NoBrokersAvailable
The second failure mode is actually not intuitive for me and judging from this SO question or this one, I am not the only one who is not able to guess that there is in fact a broker available, but the api_version is missing.
I think it would be great if there would me a more meaningful exception (like UnsupportedApiVersion) that is indicating to the user that the api version that he is requesting (as per the default value of this library) is not available/not supported by the Kafka he is trying to connect to.