k0b3rIT commented on code in PR #18994:
URL: https://github.com/apache/kafka/pull/18994#discussion_r1983354424
##########
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:
I thought the simple hostname is sufficient to identify the host, and we
don't need reverse dns lookup.
But if you think that's better, I have no objections to use that. It will be
just an identifier and won't be used for communication.
--
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]