client ====>>> My Name's Order Service,Are you Afraid?123
battcn-config-server日志
1 2 3 4
2017-08-21 20:45:09.048 INFO 11420 --- [nio-9000-exec-3] o.s.cloud.commons.util.InetUtils : Cannot determine local hostname 2017-08-21 20:45:09.074 INFO 11420 --- [nio-9000-exec-3] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5e6721d9: startup date [Mon Aug 21 20:45:09 CST 2017]; root of context hierarchy 2017-08-21 20:45:09.080 INFO 11420 --- [nio-9000-exec-3] o.s.c.c.s.e.NativeEnvironmentRepository : Adding property source: classpath:/config-server-order-default.yml 2017-08-21 20:45:09.080 INFO 11420 --- [nio-9000-exec-3] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@5e6721d9: startup date [Mon Aug 21 20:45:09 CST 2017]; root of context hierarchy
battcn-config-client日志
1 2 3 4 5 6 7 8 9 10 11 12 13
2017-08-21 20:45:54.896 INFO 16768 --- [nio-9001-exec-8] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7dc4513: startup date [Mon Aug 21 20:45:54 CST 2017]; root of context hierarchy 2017-08-21 20:45:54.906 INFO 16768 --- [nio-9001-exec-8] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2017-08-21 20:45:54.907 INFO 16768 --- [nio-9001-exec-8] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$6f70a08a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2017-08-21 20:45:55.973 INFO 16768 --- [nio-9001-exec-8] o.s.cloud.commons.util.InetUtils : Cannot determine local hostname 2017-08-21 20:45:55.994 INFO 16768 --- [nio-9001-exec-8] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:9000 2017-08-21 20:45:57.093 INFO 16768 --- [nio-9001-exec-8] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=config-server, profiles=[order-default], label=null, version=null, state=null 2017-08-21 20:45:57.093 INFO 16768 --- [nio-9001-exec-8] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='classpath:/config-server-order-default.yml']]] 2017-08-21 20:45:57.094 INFO 16768 --- [nio-9001-exec-8] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default 2017-08-21 20:45:57.095 INFO 16768 --- [nio-9001-exec-8] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@676107bb: startup date [Mon Aug 21 20:45:57 CST 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@7dc4513 2017-08-21 20:45:57.096 INFO 16768 --- [nio-9001-exec-8] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2017-08-21 20:45:57.099 INFO 16768 --- [nio-9001-exec-8] o.s.boot.SpringApplication : Started application in 3.294 seconds (JVM running for 1514.761) 2017-08-21 20:45:57.099 INFO 16768 --- [nio-9001-exec-8] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@676107bb: startup date [Mon Aug 21 20:45:57 CST 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@7dc4513 2017-08-21 20:45:57.217 INFO 16768 --- [nio-9001-exec-8] o.s.cloud.bus.event.RefreshListener : Received remote refresh request. Keys refreshed []
Spring Cloud Bus对这种场景也有很好的支持:/bus/refresh接口还提供了destination参数,用来定位具体要刷新的应用程序。比如,我们可以请求/bus/refresh?destination=customers:9000,此时总线上的各应用实例会根据destination属性的值来判断是否为自己的实例名,若符合才进行配置刷新,若不符合就忽略该消息。