Added port number to response (#3431)
This commit is contained in:
parent
f993bc0435
commit
a9d5b406a5
|
@ -21,12 +21,17 @@ public class EurekaClientApplication implements GreetingController {
|
|||
@Value("${spring.application.name}")
|
||||
private String appName;
|
||||
|
||||
@Value("${server.port}")
|
||||
private String portNumber;
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(EurekaClientApplication.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String greeting() {
|
||||
return String.format("Hello from '%s'!", eurekaClient.getApplication(appName).getName());
|
||||
System.out.println("Request received on port number " + portNumber);
|
||||
return String.format("Hello from '%s with Port Number %s'!", eurekaClient.getApplication(appName)
|
||||
.getName(), portNumber);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ spring:
|
|||
name: spring-cloud-eureka-client
|
||||
|
||||
server:
|
||||
port: 0
|
||||
port: 8081
|
||||
|
||||
eureka:
|
||||
client:
|
||||
|
|
Loading…
Reference in New Issue