smjn commented on code in PR #21471:
URL: https://github.com/apache/kafka/pull/21471#discussion_r2803166024


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:
##########
@@ -1114,6 +1114,9 @@ private void maybeThrowInvalidGroupIdException() {
             throw new InvalidGroupIdException(
                     "You must provide a valid " + 
ConsumerConfig.GROUP_ID_CONFIG + " in the consumer configuration.");
         }
+        if (groupId.contains(":")) {
+            throw new InvalidGroupIdException("Group ID must not contain ':' 
for share consumers.");
+        }

Review Comment:
   The change should be in 
https://github.com/apache/kafka/blob/trunk/server-common/src/main/java/org/apache/kafka/server/share/SharePartitionKey.java#L75
   
   something like:
   ```
   public static SharePartitionKey getInstance(String key) {
           validate(key);
           String[] tokens = key.split(":");
           int last =  tokens.length - 1;
           //String groupId = String.join(":", Arrays.copyOfRange(tokens, 0, 
last-1));
          // OR
         // String groupId = key.substring(data.lastIndexOf(":", 
data.lastIndexOf(":")-1));
           return new SharePartitionKey(
                   groupId,
                   Uuid.fromString(tokens[last-1]),
                   Integer.parseInt(tokens[last])
           );
       }
   ```
   
   as well as update in `validate` in same class



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