diff --git a/jcpp-infrastructure-queue/src/main/java/sanbing/jcpp/infrastructure/queue/discovery/DefaultServiceInfoProvider.java b/jcpp-infrastructure-queue/src/main/java/sanbing/jcpp/infrastructure/queue/discovery/DefaultServiceInfoProvider.java index 2c8a1f9..75a424d 100644 --- a/jcpp-infrastructure-queue/src/main/java/sanbing/jcpp/infrastructure/queue/discovery/DefaultServiceInfoProvider.java +++ b/jcpp-infrastructure-queue/src/main/java/sanbing/jcpp/infrastructure/queue/discovery/DefaultServiceInfoProvider.java @@ -62,7 +62,7 @@ public class DefaultServiceInfoProvider implements ServiceInfoProvider { } log.info("Current Service ID: {}", serviceId); - hostAddress = InetAddress.getLocalHost().getHostAddress(); + hostAddress = InetAddress.getLocalHost().getHostName(); log.info("Current Service HostAddress: {}, RestPort:{}, GrpcPort:{}", hostAddress, restPort, grpcPort); if (serviceType.equalsIgnoreCase("monolith")) {