spring-cloud/spring-cloud-netflix

<instanceId>HOST:APP:0</instanceId>

wuhao9346 opened this issue · 2 comments

version:3.1.7

When the service port is configured to 0, the registered port is updated during Web service initialization, but the instance id is not updated, and the port is still 0

http://127.0.0.1:8761/eureka/apps

<applications>
    <versions__delta>1</versions__delta>
    <apps__hashcode>UP_2_</apps__hashcode>
    <application>
        <name>APP</name>
        <instance>
            <instanceId>HOST:APP:0</instanceId>
            <hostName>HOST</hostName>
            <app>APP</app>
            <ipAddr>127.0.0.1</ipAddr>
            <status>UP</status>
            <overriddenstatus>UNKNOWN</overriddenstatus>
            <port enabled="true">59757</port>
            <securePort enabled="false">443</securePort>
            <countryId>1</countryId>
            <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
                <name>MyOwn</name>
            </dataCenterInfo>
            <leaseInfo>
                <renewalIntervalInSecs>10</renewalIntervalInSecs>
                <durationInSecs>90</durationInSecs>
                <registrationTimestamp>1723010981445</registrationTimestamp>
                <lastRenewalTimestamp>1723011076802</lastRenewalTimestamp>
                <evictionTimestamp>0</evictionTimestamp>
                <serviceUpTimestamp>1722949452387</serviceUpTimestamp>
            </leaseInfo>
            <metadata>
                <instanceId>APP:${spring.cloud.client.port}</instanceId>
            </metadata>
            <homePageUrl>http://HOST:59757/</homePageUrl>
            <statusPageUrl>http://HOST:59757/actuator/info</statusPageUrl>
            <healthCheckUrl>http://HOST:59757/actuator/health</healthCheckUrl>
            <vipAddress>APP</vipAddress>
            <secureVipAddress>APP</secureVipAddress>
            <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
            <lastUpdatedTimestamp>1723010981445</lastUpdatedTimestamp>
            <lastDirtyTimestamp>1723010980856</lastDirtyTimestamp>
            <actionType>ADDED</actionType>
        </instance>
    </application>
</applications>

application.yml

server:
  port: 0
eureka:
  password: password
  client:
    serviceUrl:
      defaultZone: http://user:${eureka.password}@localhost:8761/eureka/
  instance:
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${spring.cloud.client.port}}}

Hello @wuhao9346, thanks for reporting the issue. 3.1.x is out of OSS support. Please upgrade to a supported version (4.1.4) and verify. If the issue persists, please provide a minimal, complete, verifiable example that reproduces the issue.

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.