diff --git a/turbine/src/main/resources/application.properties b/turbine/src/main/resources/application.properties index 6449849..1660d2e 100644 --- a/turbine/src/main/resources/application.properties +++ b/turbine/src/main/resources/application.properties @@ -1,4 +1,5 @@ server.port: 8989 spring.application.name: turbine -turbine.appConfig: simple -turbine.aggregator.clusterConfig: SIMPLE +turbine.appConfig: simple,other +turbine.aggregator.clusterConfig: MAIN +turbine.clusterNameExpression: metadata['cluster'] \ No newline at end of file diff --git a/turbine/src/test/java/apps/SimpleApplication.java b/turbine/src/test/java/apps/SimpleApplication.java index 13b3f88..d24596f 100644 --- a/turbine/src/test/java/apps/SimpleApplication.java +++ b/turbine/src/test/java/apps/SimpleApplication.java @@ -36,47 +36,47 @@ import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; @EnableCircuitBreaker @RestController public class SimpleApplication { - + @Autowired private HelloService service; - + @RequestMapping("/") public String hello() { - return service.hello(); + return this.service.hello(); } - + @RequestMapping("/session") public String session(HttpSession session) { return session.getId(); } - + @RequestMapping("/fail") public String fail() { - return service.fail(); + return this.service.fail(); } public static void main(String[] args) { new SpringApplicationBuilder(SimpleApplication.class).properties( "spring.config.name:simple").run(args); } - + @Service public static class HelloService { - + @HystrixCommand(fallbackMethod="fallback") public String hello() { return "Hello World"; } - + @HystrixCommand(fallbackMethod="fallback") public String fail() { throw new RuntimeException("Planned"); } - + public String fallback() { return "Fallback"; } } - + } diff --git a/turbine/src/test/resources/simple.properties b/turbine/src/test/resources/simple.properties index ec7a5fc..9be4e14 100644 --- a/turbine/src/test/resources/simple.properties +++ b/turbine/src/test/resources/simple.properties @@ -1,2 +1,3 @@ server.port: 8080 spring.application.name: simple +eureka.instance.metadata-map.cluster: MAIN \ No newline at end of file