ankurgar9 commented on code in PR #24360:
URL: https://github.com/apache/kafka/pull/24360#discussion_r4679674086


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -662,11 +664,19 @@ private static void validateValues(
         );
 
         // DLQ validation (KIP-1191)
-        // DLQ topic name must not start with "__" (reserved for internal 
topics)
+        // DLQ topic name is a valid topic name and must not start with "__" 
(reserved for internal topics)
         String dlqTopicName = (String) 
parsed.get(ERRORS_DEADLETTERQUEUE_TOPIC_NAME_CONFIG);
-        if (dlqTopicName != null && !dlqTopicName.isEmpty() && 
dlqTopicName.startsWith("__")) {
-            throw new 
InvalidConfigurationException(ERRORS_DEADLETTERQUEUE_TOPIC_NAME_CONFIG +
-                ": DLQ topic name must not start with '__'");
+        if (dlqTopicName != null && !dlqTopicName.isEmpty()) {
+            try {
+                Topic.validate(dlqTopicName);
+            } catch (InvalidTopicException invalidTopicException) {
+                throw new 
InvalidConfigurationException(ERRORS_DEADLETTERQUEUE_TOPIC_NAME_CONFIG +
+                    " - DLQ topic name is not valid: " + 
invalidTopicException.getMessage());
+            }
+            if (dlqTopicName.startsWith("__")) {

Review Comment:
   Think this can be brought up before the first If condition. 



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