goutamadwant commented on code in PR #4320:
URL: https://github.com/apache/hertzbeat/pull/4320#discussion_r3860042030


##########
hertzbeat-common-core/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/KafkaProtocol.java:
##########
@@ -74,6 +113,16 @@ public boolean isInvalid() {
                 && !"false".equalsIgnoreCase(monitorInternalTopic)) {
             return true;
         }
-        return false;
+        if (StringUtils.isNotBlank(securityProtocol)
+                && 
!SECURITY_PROTOCOLS.contains(securityProtocol.toUpperCase(Locale.ROOT))) {
+            return true;
+        }
+        if (!hasSaslAuthentication()) {
+            return StringUtils.isNotBlank(saslMechanism)
+                    || StringUtils.isNotBlank(username)
+                    || StringUtils.isNotBlank(password);

Review Comment:
   @Duansg existing monitors remain backward compatible. Persisted monitor 
definitions have no values for the new fields, so `securityProtocol` and the 
SASL fields deserialize blank; `KafkaProtocol.isInvalid()` continues to accept 
that state, and `getAdminClientProperties()` emits only `bootstrap.servers`, 
matching the previous behavior.
   
   The YAML default applies `PLAINTEXT` only when creating or editing a 
definition.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to