eriklupander / go-microservice-eureka

Sample golang project with a simple http service exposing itself by registering with Eureka.
MIT License
51 stars 15 forks source link

It cant register itself to eureka #1

Open zjx-immersion opened 8 years ago

zjx-immersion commented 8 years ago

Hi Man

I encounter a issue when using your repo to register to Eureka. in Eureka side we could saw as below:

discovery | 2016-11-07 08:52:05.249 WARN 1 --- [nio-8761-exec-4] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: lease doesn't exist, registering resource: VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765 discovery | 2016-11-07 08:52:05.249 WARN 1 --- [nio-8761-exec-4] c.n.eureka.resources.InstanceResource : Not Found (Renew): VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765 discovery | 2016-11-07 08:52:35.256 WARN 1 --- [io-8761-exec-10] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: lease doesn't exist, registering resource: VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765 discovery | 2016-11-07 08:52:35.256 WARN 1 --- [io-8761-exec-10] c.n.eureka.resources.InstanceResource : Not Found (Renew): VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765 discovery | 2016-11-07 08:53:05.263 WARN 1 --- [nio-8761-exec-4] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: lease doesn't exist, registering resource: VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765

Can you help? thanks a lot!

eriklupander commented 7 years ago

Hi,

I got the same issue when I tried to get things up and running. I added ;charset=UTF-8 to the Content-Type header, e.g:

Content-Type: application/json;charset=UTF-8

E.g. in the eurekaclient.go file.

I was running against a quite new Spring Clound Eureka instance provided by a Spring Boot application.

Also, I'm having issues with my service disappearing from Eureka with "Registry: lease doesn't exist, registering resource" in the Eureka log. Still troubleshooting that.

Hope this helps.

spectre013 commented 6 years ago

I was able to get it to register with the following

{ "instance": { "instanceId": "vendor:${instanceId}", "hostName": "${ipAddress}", "app": "vendor", "ipAddr": "${ipAddress}", "vipAddress": "vendor-data-service", "status": "UP", "port": { "$":8080, "@enabled": "true" }, "securePort": { "$": 8443, "@enabled": "false" }, "homePageUrl": "http://${ipAddress}:${port}/", "statusPageUrl": "http://${ipAddress}:${port}/info", "healthCheckUrl": "http://${ipAddress}:${port}/health", "dataCenterInfo": { "@class": "com.netflix.appinfo.MyDataCenterInfo", "name": "MyOwn" } } }

stevebaros commented 3 years ago

Does this still work ?

eriklupander commented 3 years ago

Hi, I have not looked at this repo for several years, I kind of suspect that it is terribly out of date.

stevebaros commented 3 years ago

Hi, I have not looked at this repo for several years, I kind of suspect that it is terribly out of date.

Thank you .

HamdiMahjoub commented 2 years ago

Hi, I just inject this dependency and it works !

    <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-loadbalancer -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-loadbalancer</artifactId>
        <version>3.1.4</version>
    </dependency>