[ https://issues.apache.org/jira/browse/BEAM-6285?focusedWorklogId=191125&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-191125 ]
ASF GitHub Bot logged work on BEAM-6285: ---------------------------------------- Author: ASF GitHub Bot Created on: 28/Jan/19 17:04 Start Date: 28/Jan/19 17:04 Worklog Time Spent: 10m Work Description: aromanenko-dev commented on pull request #7598: [BEAM-6285] add parameters for offsetConsumer in KafkaIO.read() URL: https://github.com/apache/beam/pull/7598#discussion_r251502349 ########## File path: sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java ########## @@ -656,6 +661,24 @@ return toBuilder().setCommitOffsetsInFinalizeEnabled(true).build(); } + /** + * Set additional configuration for the backend offset consumer. It may be required for a + * secured Kafka cluster, especially when you see similar WARN log message 'exception while + * fetching latest offset for partition {}. will be retried'. + * + * <p>In {@link KafkaIO#read()}, there're two consumers running in the backend actually:<br> + * 1. the main consumer, which reads data from kafka;<br> + * 2. the secondary offset consumer, which is used to estimate backlog, by fetching latest + * offset;<br> + * + * <p>By default, offset consumer inherits the configuration from main consumer, with an + * auto-generated {@link ConsumerConfig#GROUP_ID_CONFIG}. This may not work in a secured Kafka + * which requires more configurations. + */ Review comment: I'd recommend also to mention for end user that `ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG` and `ConsumerConfig.ISOLATION_LEVEL_CONFIG` won't be overridden in any case. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 191125) Time Spent: 3h (was: 2h 50m) > add parameters for offsetConsumer in KafkaIO.read() > --------------------------------------------------- > > Key: BEAM-6285 > URL: https://issues.apache.org/jira/browse/BEAM-6285 > Project: Beam > Issue Type: Improvement > Components: io-java-kafka > Reporter: Xu Mingmin > Assignee: Xu Mingmin > Priority: Major > Time Spent: 3h > Remaining Estimate: 0h > > Add an option in KafkaIO.read() to avoid using `offsetConsumer`. > *What's the problem:* > When security is enabled, function > `KafkaUnboundedReader.updateLatestOffsets()` always fails with lots of WARN > log. > *What's the cause:* > `offsetConsumer` uses a mocked `ConsumerConfig.GROUP_ID_CONFIG`, and it > doesn't work as expected when security is enabled. In our case, > `ConsumerConfig.GROUP_ID_CONFIG` is the key to validate whether this consumer > is approved. > *What's the solution:* > Add an option to disable `offsetConsumer` by developers; > *What's the side effect:* > With `offsetConsumer` disabled, backlog is unknown. > > [~rangadi] any comments? > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)