diff --git a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java index f35d50e6..fc247742 100644 --- a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java +++ b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java @@ -39,7 +39,7 @@ public class DiscoveryConfiguration { public InstanceInfo instanceConfig() { String namespace = properties.getNamespace(); String itemId = properties.getItemId(); - String port = environment.getProperty("server.port"); + String port = environment.getProperty("server.port", "8080"); String applicationName = environment.getProperty("spring.dynamic.thread-pool.item-id"); String active = environment.getProperty("spring.profiles.active", "UNKNOWN"); diff --git a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/IdentifyUtil.java b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/IdentifyUtil.java index ed56098f..1d3da94e 100644 --- a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/IdentifyUtil.java +++ b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/IdentifyUtil.java @@ -37,7 +37,7 @@ public class IdentifyUtil { return identify; } String ip = hippo4JInetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); - String port = environment.getProperty("server.port"); + String port = environment.getProperty("server.port", "8080"); String identification = StrUtil.builder(ip, ":", port,