AndrewJSchofield commented on code in PR #14768:
URL: https://github.com/apache/kafka/pull/14768#discussion_r1394821601


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/LegacyKafkaConsumer.java:
##########
@@ -150,11 +150,9 @@ public class LegacyKafkaConsumer<K, V> implements 
ConsumerDelegate<K, V> {
             LogContext logContext = createLogContext(config, 
groupRebalanceConfig);
             this.log = logContext.logger(getClass());
             boolean enableAutoCommit = 
config.getBoolean(ENABLE_AUTO_COMMIT_CONFIG);
-            groupId.ifPresent(groupIdStr -> {
-                if (groupIdStr.isEmpty()) {
-                    log.warn("Support for using the empty group id by 
consumers is deprecated and will be removed in the next major release.");
-                }
-            });
+
+            if (this.groupId.isPresent() && this.groupId.get().isEmpty())

Review Comment:
   Trim please.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -163,11 +163,9 @@ public class AsyncKafkaConsumer<K, V> implements 
ConsumerDelegate<K, V> {
             this.clientId = 
config.getString(CommonClientConfigs.CLIENT_ID_CONFIG);
             LogContext logContext = createLogContext(config, 
groupRebalanceConfig);
             this.log = logContext.logger(getClass());
-            groupId.ifPresent(groupIdStr -> {
-                if (groupIdStr.isEmpty()) {
-                    log.warn("Support for using the empty group id by 
consumers is deprecated and will be removed in the next major release.");
-                }
-            });
+
+            if (this.groupId.isPresent() && this.groupId.get().isEmpty())

Review Comment:
   This works for a group id which is the empty string, but not for a 
whitespace string. I think `this.groupId.get().trim().isEmpty()` will do it.



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