eliaslevy commented on issue #6577: [FLINK-7964] Add Apache Kafka 1.0/1.1 
connectors
URL: https://github.com/apache/flink/pull/6577#issuecomment-418436718
 
 
   If you need to determine that a broker does not support transactions before 
trying to make use of them, it may be possible to do so via 
[`NodeApiVersions.latestUsableVersion`](https://github.com/apache/kafka/blob/3cdc78e6bb1f83973a14ce1550fe3874f7348b05/clients/src/main/java/org/apache/kafka/clients/NodeApiVersions.java#L91).
 
   
   You'd have to iterate over the cluster nodes and check 
`apiVersions.latestUsableVersion(ApiKeys.PRODUCE)` is `>= 3`.  Version 3 of the 
produce request [introduced 
transactions](https://kafka.apache.org/protocol#The_Messages_Produce).
   
   Although deprecated, the Scala 
[`AdminClient`](https://github.com/apache/kafka/blob/fc5f6b0e46ff81302b3e445fed0cdf454c942792/core/src/main/scala/kafka/admin/AdminClient.scala)
 has code that demonstrates how to obtain this information.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to