hudl / fargo

Golang client for Netflix Eureka
MIT License
133 stars 53 forks source link

Add property instanceId and optimize #67

Closed co-kevin closed 6 years ago

co-kevin commented 6 years ago

Sample eureka app information

<application>
  <name>DATASTASH</name>
  <instance>
    <instanceId>192.168.1.5:datastash:9999</instanceId>
    <hostName>192.168.1.5</hostName>
    <app>DATASTASH</app>
    <ipAddr>192.168.1.5</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="false">9999</port>
    <securePort enabled="false">0</securePort>
    <countryId>0</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>1</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1527566622799</registrationTimestamp>
      <lastRenewalTimestamp>1527575064425</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1527566622290</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://192.168.1.5:9999</homePageUrl>
    <statusPageUrl>http://192.168.1.5:9999/info</statusPageUrl>
    <healthCheckUrl>http://192.168.1.5:9999/health</healthCheckUrl>
    <vipAddress>192.168.1.5</vipAddress>
    <secureVipAddress>192.168.1.5</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1527566622799</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1527566622290</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>
CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

seh commented 6 years ago

Related history: #43.

co-kevin commented 6 years ago

This is not the same. #43 We all use datacenter Spring Eureka Server. screen shot 2018-05-30 at 10 11 18

The 192.168.1.5:datastash:9999 is service DATASTASH instance id. if don't have this property, it will use hostName as the instance id. Instance id will conflict when multiple services are deployed on a single server.

But #43 has an issues, start heartbeat will have a 404 error, because it's not in use instance id as the only sign of service. Considering that it has been a long time, I resubmitted a PR.

damtur commented 6 years ago

Thank you @hookszhang for your contribution and thank you @seh for reviewing as always. This change has been merged.