[ https://issues.apache.org/jira/browse/GOBBLIN-1040?focusedWorklogId=395737&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-395737 ]
ASF GitHub Bot logged work on GOBBLIN-1040: ------------------------------------------- Author: ASF GitHub Bot Created on: 02/Mar/20 02:42 Start Date: 02/Mar/20 02:42 Worklog Time Spent: 10m Work Description: sv2000 commented on pull request #2900: [GOBBLIN-1040] HighLevelConsumer re-design by removing references to … URL: https://github.com/apache/incubator-gobblin/pull/2900#discussion_r386174010 ########## File path: gobblin-runtime/src/test/java/org/apache/gobblin/runtime/kafka/HighLevelConsumerTest.java ########## @@ -51,32 +101,69 @@ private static String getConfigKey(Optional<String> prefix, String key) { } @Test - public void test() throws Exception { + public void testConsumerAutoOffsetCommit() throws Exception { + Properties consumerProps = new Properties(); + consumerProps.setProperty(ConfigurationKeys.KAFKA_BROKERS, _kafkaBrokers); + consumerProps.setProperty(Kafka09ConsumerClient.GOBBLIN_CONFIG_VALUE_DESERIALIZER_CLASS_KEY, "org.apache.kafka.common.serialization.ByteArrayDeserializer"); + consumerProps.setProperty("source.kafka.consumerConfig.auto.offset.reset", "earliest"); - MockKafkaStream mockKafkaStream = new MockKafkaStream(5); - MockedHighLevelConsumer consumer = new MockedHighLevelConsumer(getSimpleConfig(Optional.<String>absent()), 5, mockKafkaStream); + MockedHighLevelConsumer consumer = new MockedHighLevelConsumer(TOPIC, ConfigUtils.propertiesToConfig(consumerProps), NUM_PARTITIONS); + consumer.startAsync().awaitRunning(); - consumer.startAsync(); - consumer.awaitRunning(); - - Assert.assertTrue(consumer.getMessages().isEmpty()); + consumer.awaitExactlyNMessages(NUM_MSGS, 5000); + consumer.shutDown(); + } - mockKafkaStream.pushToStream("message"); + @Test + public void testConsumerManualOffsetCommit() throws Exception { + Properties consumerProps = new Properties(); + consumerProps.setProperty(ConfigurationKeys.KAFKA_BROKERS, _kafkaBrokers); + consumerProps.setProperty(Kafka09ConsumerClient.GOBBLIN_CONFIG_VALUE_DESERIALIZER_CLASS_KEY, "org.apache.kafka.common.serialization.ByteArrayDeserializer"); + consumerProps.setProperty("source.kafka.consumerConfig.auto.offset.reset", "earliest"); + consumerProps.put("enable.auto.commit", false); Review comment: HighLevelConsumer.ENABLE_AUTO_COMMIT instead of enable.auto.commit. ---------------------------------------------------------------- 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 Issue Time Tracking ------------------- Worklog Id: (was: 395737) Time Spent: 2.5h (was: 2h 20m) > Fix High level consumer > ------------------------ > > Key: GOBBLIN-1040 > URL: https://issues.apache.org/jira/browse/GOBBLIN-1040 > Project: Apache Gobblin > Issue Type: Improvement > Reporter: Vikram Bohra > Priority: Major > Time Spent: 2.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)