fred-ro commented on code in PR #17086:
URL: https://github.com/apache/kafka/pull/17086#discussion_r1744104384


##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -370,9 +370,9 @@ private void warnIfPartitionerDeprecated() {
             MetricConfig metricConfig = new 
MetricConfig().samples(config.getInt(ProducerConfig.METRICS_NUM_SAMPLES_CONFIG))
                     
.timeWindow(config.getLong(ProducerConfig.METRICS_SAMPLE_WINDOW_MS_CONFIG), 
TimeUnit.MILLISECONDS)
                     
.recordLevel(Sensor.RecordingLevel.forName(config.getString(ProducerConfig.METRICS_RECORDING_LEVEL_CONFIG)))
-                    .tags(metricTags);
-            List<MetricsReporter> reporters = 
CommonClientConfigs.metricsReporters(clientId, config);
+                    .tags(metricTags);            
             this.clientTelemetryReporter = 
CommonClientConfigs.telemetryReporter(clientId, config);

Review Comment:
   True but I do not see how an exception can be emitted before (except OOM).
   Then checking for null an Optional looks very strange. In that case I would 
rather remove the Optional or make it non final with a default empty value.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to