aromanenko-dev commented on a change in pull request #11099: [BEAM-9420] Configurable timeout for blocking kafka API call(s) URL: https://github.com/apache/beam/pull/11099#discussion_r397121739
########## File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java ########## @@ -827,6 +832,19 @@ public void setValueDeserializer(String valueDeserializer) { return toBuilder().setOffsetConsumerConfig(offsetConsumerConfig).build(); } + /** + * Sets a default timeout to use for API calls to Kafka which are possibly blocking. {@link + * KafkaIO.Read} will not wait indefinitely for such calls but cancels them and fail after given + * timeout. + * + * <p>Higher versions of kafka client library supports such API timeout, which is passed in + * consumer config as `default.api.timeout.ms`. If timeout is not explicitly set here, then + * {@link KafkaIO.Read} will look for `default.api.timeout.ms` parameter in consumer config. + */ + public Read<K, V> withDefaultKafkaApiTimeout(Duration timeout) { Review comment: Thanks! Please, add a comment about that into KafkaIO class javadoc to make it clear for users. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services