mjsax commented on code in PR #17259:
URL: https://github.com/apache/kafka/pull/17259#discussion_r1772483525


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/ActiveTaskCreator.java:
##########
@@ -304,17 +291,11 @@ void closeAndRemoveTaskProducerIfNeeded(final TaskId id) {
     }
 
     Map<MetricName, Metric> producerMetrics() {
-        // When EOS is turned on, each task will have its own producer client
-        // and the producer object passed in here will be null. We would then 
iterate through
-        // all the active tasks and add their metrics to the output metrics 
map.
-        final Collection<StreamsProducer> producers = threadProducer != null ?
-            Collections.singleton(threadProducer) :
-            taskProducers.values();
-        return ClientUtils.producerMetrics(producers);
+        return 
ClientUtils.producerMetrics(Collections.singleton(threadProducer));

Review Comment:
   We maybe could change `producerMetrics` to only take a single `Producer` 
instead of a `Collection`. However, it does not make a big difference, and we 
might add a second producer in the future, so maybe best to least as-is.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to