I have the following service-XXXX (eureka server) It has @EnableEurekaServer in main class

applciation.yml

eureka:
instance: localhost
client:
  register-with-eureka: false
  fetch-registry: false
  serviceUrl:
    defaultZone: http://localhost:8761

pom.xml org.springframework.cloud spring-cloud-starter-netflix-eureka-server RAXXXX (eureka -client) it has @EnableDiscoveryClient although I understand this is optional

application.yml

eureka:
    client:
        register-with-eureka: true
        fetchRegistry: true
        serviceUrl:
            defaultZone: http://localhost:8761/eureka/

pom.xml org.springframework.cloud spring-cloud-starter-netflix-eureka-client RAXXXX (eureka-client) These are python services and they registered

Note :-

I see all of these are registered in http://localhost:8761/eureka/ I also can see RAXXXX is able to get the "current list of Servers" with out any issues Issue: The problem is RAXXXXX is not able to get the "current list of Servers" if all the above three services are dockerised

My docker-compose.yml below

version: '3.8'
services:
  service-registry-XXXX:
    image: c360saascr.azurecr.io/service-registry-XXXX
    ports:
      - "8761:8761"
  risk-analysis-XXXX:
    image: c360saascr.azurecr.io/risk-analysis-XXXX
    ports:
      - "8080:8080"
    command: -Xms12g -Xmx12g -XX:ActiveProcessorCount=8 -Deureka.client.serviceUrl.defaultZone=http://service-registry-service:8761/eureka -verbose:gc -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError   -XX:HeapDumpPath=heapdumps -jar risk-analysis-handler-0.0.1-SNAPSHOT.jar
  risk-analysis-XXXX:
    image: c360saascr.azurecr.io/risk-analysis-XXXX
    ports:
    - "5001:5001"
    command: http://service-registry-XXXX:8761 risk-analysis-service5001 5001 risk-analysis-service-5001.log
    restart: on-failure

For security concern I need to add XXXX.

What I tried?

  1. Initially I had three different containers with --link in each. Upon reading a stackoverflow post I created docker-compose.yml
  2. Tried register-with-eureka: true and fetchRegistry: true
  3. Tried docker inspect and replaced -Deureka.client.serviceUrl.defaultZone=http://service-registry-service:8761/eureka with proper ip
  4. In docker-compose.yml tried creating a network and attached that to all the three services.
  5. I see c.netflix.config.ChainedDynamicProperty being called twice in local and once if dockerised. Sadly second time it brings the list of servers (in my local). Wondering this might be the problem but how to make it call twice?

Comment From: spencergibb

Please learn how to properly format code and logs.

localhost in default zone is not correct.

Comment From: hariraogotit

I override it as -Deureka.client.serviceUrl.defaultZone=http://service-registry-service:8761/eureka as u see in the docker-compose.yml

command: -Xms12g -Xmx12g -XX:ActiveProcessorCount=8 -Deureka.client.serviceUrl.defaultZone=http://service-registry-service:8761/eureka -verbose:gc -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=heapdumps -jar risk-analysis-handler-0.0.1-SNAPSHOT.jar

Comment From: spencergibb

I'm unsure how to proceed and assume there is a problem in the docker configuration or networking.

Comment From: hariraogotit

They all are in the same network. Does the below seem strange?

I see c.netflix.config.ChainedDynamicProperty being called twice in local and once if dockerised. Sadly second time it brings the list of servers (in my local). Wondering this might be the problem but how to make it call twice?

Comment From: spencergibb

:man_shrugging: That's in upstream netflix code. I have no idea why it would be different in docker.

Comment From: hariraogotit

Thats the only difference I see between my local instance and dockerised instance

Comment From: OlgaMaciaszek

@hariraogotit, please provide a minimal, complete, verifiable example that reproduces the issue, along with a README containing the steps necessary to run the app locally and in docker - I will have a look at it then.

Comment From: spring-projects-issues

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.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.