You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/02/19 18:50:23 UTC

[GitHub] [gobblin] sv2000 commented on a change in pull request #3231: [GOBBLIN-1391] Filter Kafka topics in kafka consumer client with No s…

sv2000 commented on a change in pull request #3231:
URL: https://github.com/apache/gobblin/pull/3231#discussion_r579403158



##########
File path: gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/AbstractBaseKafkaConsumerClient.java
##########
@@ -54,13 +58,14 @@
   protected final int fetchTimeoutMillis;
   protected final int fetchMinBytes;
   protected final int socketTimeoutMillis;
+  protected final KafkaSchemaRegistry schemaRegistry;
 
   public AbstractBaseKafkaConsumerClient(Config config) {
     this.brokers = ConfigUtils.getStringList(config, ConfigurationKeys.KAFKA_BROKERS);
     if (this.brokers.isEmpty()) {
       throw new IllegalArgumentException("Need to specify at least one Kafka broker.");
     }
-
+    this.schemaRegistry = KafkaSchemaRegistry.get(ConfigUtils.configToProperties(config));

Review comment:
       Also - can we do a lazy instantiation of KafkaSchemaRegistry inside getFilteredTopics() method? We only need the schema registry check for filtering the list of topics. 

##########
File path: gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/AbstractBaseKafkaConsumerClient.java
##########
@@ -54,13 +58,14 @@
   protected final int fetchTimeoutMillis;
   protected final int fetchMinBytes;
   protected final int socketTimeoutMillis;
+  protected final KafkaSchemaRegistry schemaRegistry;
 
   public AbstractBaseKafkaConsumerClient(Config config) {
     this.brokers = ConfigUtils.getStringList(config, ConfigurationKeys.KAFKA_BROKERS);
     if (this.brokers.isEmpty()) {
       throw new IllegalArgumentException("Need to specify at least one Kafka broker.");
     }
-
+    this.schemaRegistry = KafkaSchemaRegistry.get(ConfigUtils.configToProperties(config));

Review comment:
       What happens when Kafka Schema Registry is not enabled? Shouldn't we check if the config kafka.schema.registry.url is set?




----------------------------------------------------------------
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:
users@infra.apache.org