Describe the bug Please provide details of the problem, including the version of Spring Cloud that you are using.

Sample If possible, please provide a test case or sample application that reproduces the problem. This makes it much easier for us to diagnose the problem and to verify that we have fixed it.

  1. Set up a eureka server
  2. Set up a spring boot client
  3. Start client with port=0
  4. Open eureka UI

It will show the port as 0 and if you spin up miltiple services with port 0, eureka will only show 1

Spring Cloud Netflix If you start client with a port=0, it shows port 0 and doesnt show multiple instances

Comment From: arikanorh

I did some debugging and found the relevant registry code

Spring Cloud Netflix If you start client with a port=0, it shows port 0 and doesnt show multiple instances

The map that holds the key is using registrant.getId() which says the port is 0 but infact it is not as seen in the debugger port information

Comment From: spencergibb

Duplicates #843