Ensure management.port defaults to server.port for eureka registration

Otherwise apps register the wrong health and status URLs by default. If
there is no explicit management.port we just need a default that is
the same as server.port.
This commit is contained in:
Dave Syer
2016-01-19 07:04:35 +00:00
parent be0f030ccf
commit a6e47a0b47

View File

@@ -75,7 +75,7 @@ public class EurekaClientAutoConfiguration {
@Value("${server.port:${SERVER_PORT:${PORT:8080}}}")
int nonSecurePort;
@Value("${management.port:${MANAGEMENT_PORT:${PORT:8080}}}")
@Value("${management.port:${MANAGEMENT_PORT:${server.port:${SERVER_PORT:${PORT:8080}}}}}")
int managementPort;
@Value("${eureka.instance.hostname:${EUREKA_INSTANCE_HOSTNAME:}}")