Commit c1704235 by Spencer Gibb

polish

parent 572220ae
......@@ -16,9 +16,11 @@
package org.springframework.cloud.netflix.eureka.sample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
......@@ -36,6 +38,9 @@ import com.netflix.appinfo.InstanceInfo;
@EnableEurekaClient
public class EurekaSampleApplication {
@Autowired
DiscoveryClient discoveryClient;
@Bean
public InMemoryMetricRepository inMemoryMetricRepository() {
return new InMemoryMetricRepository();
......@@ -54,7 +59,7 @@ public class EurekaSampleApplication {
@RequestMapping("/")
public String home() {
return "Hello world";
return "Hello world "+discoveryClient.getLocalServiceInstance().getUri();
}
public static void main(String[] args) {
......
......@@ -17,23 +17,14 @@
package org.springframework.cloud.netflix.sidecar;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@EnableSidecar
@EnableDiscoveryClient
@RestController
public class SidecarApplication {
@Bean
public InMemoryMetricRepository inMemoryMetricRepository() {
return new InMemoryMetricRepository();
}
public static void main(String[] args) {
SpringApplication.run(SidecarApplication.class, args);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment