kpatelatwork commented on a change in pull request #10841:
URL: https://github.com/apache/kafka/pull/10841#discussion_r651266225
##########
File path:
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfig.java
##########
@@ -497,6 +476,37 @@ static void validateHeaderConfigAction(String action) {
+ "Expected one of %s", action, HEADER_ACTIONS));
}
}
+ private static class ListenersValidator implements ConfigDef.Validator {
+ @Override
+ public void ensureValid(String name, Object value) {
+ if (value == null) {
+ throw new ConfigException("Invalid value, at least one URI is
expected, ex: http://localhost:8080,https://localhost:8443.");
+ }
+
+ if (!(value instanceof List)) {
+ throw new ConfigException("Invalid value type (list
expected).");
+ }
+
+ List items = (List) value;
+ if (items.isEmpty()) {
+ throw new ConfigException("Invalid value, at least one URI is
expected, ex: http://localhost:8080,https://localhost:8443.");
+ }
+
+ for (Object item: items) {
+ if (!(item instanceof String)) {
+ throw new ConfigException("Invalid type for listener
(expected String).");
+ }
+ if (Utils.isBlank((String) item)) {
+ throw new ConfigException("Empty listener found when
parsing list.");
Review comment:
Fixed, it was a copy paste mistake from AdminListenerValidator, I have
fixed AdminListenerValidator also, Would you please review that class changes
also and let me know its ok to change the exception message there or is it
backward incompatible?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]