diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java b/common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java index 814caa45..28ac5c92 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java +++ b/common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java @@ -24,6 +24,8 @@ public class InstanceInfo { private String hostName; + private String groupKey; + private String port; private String instanceId; diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java b/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java index 2ad70a79..3f01ff6f 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java +++ b/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java @@ -41,4 +41,17 @@ public class ContentUtil { return resultStr; } + public static String getGroupKey(String... parameters) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < parameters.length; i++) { + stringBuilder.append(parameters[i]); + + if (i < parameters.length - 1) { + stringBuilder.append(Constants.GROUP_KEY_DELIMITER); + } + } + + return stringBuilder.toString(); + } + }