viktorsomogyi commented on code in PR #18994:
URL: https://github.com/apache/kafka/pull/18994#discussion_r1983489756
##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMaker.java:
##########
@@ -291,6 +296,18 @@ private static String encodePath(String rawPath) throws
UnsupportedEncodingExcep
.replaceAll("\\+", "%20");
}
+ private String generateWorkerId(SourceAndTarget sourceAndTarget) {
+ if (config.enableInternalRest()) {
+ return advertisedUrl.getHost() + ":" + advertisedUrl.getPort() +
"/" + sourceAndTarget.toString();
+ }
+ try {
+ //UUID to make sure it is unique even if multiple workers running
on the same host
+ return InetAddress.getLocalHost().getHostName() + "/" +
sourceAndTarget.toString() + "/" + UUID.randomUUID();
Review Comment:
Well, my reason is mostly that on startup the extra cost of the reverse
lookup may not matter as much and if we ever log it, it's nicer, more
identifiable.
--
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]