nickwallen commented on a change in pull request #1488: METRON-2169: Upgrade 
Kafka/Storm
URL: https://github.com/apache/metron/pull/1488#discussion_r315797947
 
 

 ##########
 File path: 
metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/KafkaConfig.java
 ##########
 @@ -80,8 +66,8 @@ public ZkUtils zkUtils() {
   @Bean
   public Map<String, Object> consumerProperties() {
     final Map<String, Object> props = new HashMap<>();
-    props.put("bootstrap.servers", 
environment.getProperty(MetronRestConstants.KAFKA_BROKER_URL_SPRING_PROPERTY));
-    props.put("group.id", "metron-rest");
+    props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, 
environment.getProperty(MetronRestConstants.KAFKA_BROKER_URL_SPRING_PROPERTY));
+    props.put(ConsumerConfig.GROUP_ID_CONFIG, "metron-rest");
     props.put("enable.auto.commit", "false");
 
 Review comment:
   I like that you replaced these strings (like `bootstrap.servers`) so the 
compiler is more likely to catch any changes to the property names that might 
be made in Kafka as part of the upgrade.
   
   Since you already went half-way, here are the others.
   * `enable.auto.commit` -> ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG
   * `auto.commit.interval.ms` -> ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG
   * `session.timeout.ms` -> ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG
   
   
https://kafka.apache.org/20/javadoc/?org/apache/kafka/clients/consumer/ConsumerConfig.html
   

----------------------------------------------------------------
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

Reply via email to