lianetm commented on code in PR #15640:
URL: https://github.com/apache/kafka/pull/15640#discussion_r1585152310


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1892,13 +1897,13 @@ private void subscribeInternal(Collection<String> 
topics, Optional<ConsumerRebal
      * @return {@code true} if the event completed within the timeout, {@code 
false} otherwise
      */
     // Visible for testing
-    <T> T processBackgroundEvents(EventProcessor<?> eventProcessor,
+    <T> T processBackgroundEvents(EventProcessor<BackgroundEvent> 
eventProcessor,

Review Comment:
   Not introduced by this PR, but reviewing this processing I don't quite see 
the value in all [these 
lines](https://github.com/apache/kafka/blob/097522abd6b51bca2407ea0de7009ed6a2d970b4/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L1910-L1915)
 , that are even repeated further down, just for a log, when in practice this 
are both the happy path that will have 
[this](https://github.com/apache/kafka/blob/097522abd6b51bca2407ea0de7009ed6a2d970b4/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L1506)
 log from the unsubscribe. A one liner with `return 
ConsumerUtils.getResult(future);` would achieve the same and make the func much 
simpler. 
   (even if we end up using this from a func other than the unsubscribe, seems 
an overkill to have all this code for something we don't need now, or know if 
we we'll need some day)



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