Closed lly835 closed 5 years ago
@lly835 can you explain why this is causing the issue and why we should use spring.cloud.config.profile
instead of spring.application.index
? Did this work in Edgware.SR4?
@ryanjbaxter see #112
Monitor has to try and derive the appname from the file. If your appname has dashes in it (like yours does config-client), it incorrectly derives the name config (the dashes are used for profiles), therefor config-client won't respond to a refresh addressed to config.
What we want is when config-client changed, it can alse refresh config app.
@ryanjbaxter i don't test in Edgware.SR4. "spring.application.index" is Deprecated in Finchley.RELEASE.
Wouldn't you want the profile to come from spring.profiles.active
instead of spring.cloud.config.profile
?
We are running into the same issue and set the profiles using the spring.profiles.active
property.
Workaround is to set the spring.cloud.bus.id
similar to the example below:
spring:
cloud:
bus:
#Workaround for defect in https://github.com/spring-cloud/spring-cloud-bus/issues/124
id: ${vcap.application.name:${spring.application.name:application}}:${vcap.application.instance_index:${spring.profiles.active:${local.server.port:${server.port:0}}}}:${vcap.application.instance_id:${random.value}}
Granted I changed this to use spring.profiles.active
instead of spring.cloud.config.profile
. You'll want to set this on the spring-cloud-config-client side or inside of your spring cloud configuration repository.
@kurtbaker09 thank you verymuch
Using the application provided by @lly835 (after updating to the latest spring boot 2.0.6 and Finchley.SR2), using monitor worked fine for me.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Workaround is to set the
spring.cloud.bus.id
similar to the example below:spring: cloud: bus: #Workaround for defect in https://github.com/spring-cloud/spring-cloud-bus/issues/124 id: ${vcap.application.name:${spring.application.name:application}}:${vcap.application.instance_index:${spring.profiles.active:${local.server.port:${server.port:0}}}}:${vcap.application.instance_id:${random.value}}
Granted I changed this to use
spring.profiles.active
instead ofspring.cloud.config.profile
. You'll want to set this on the spring-cloud-config-client side or inside of your spring cloud configuration repository.
spring.application.index to spring.cloud.config.profile
spring.cloud.bus.id="${vcap.application.name:${spring.application.name:application}}:${vcap.application.instance_index:${spring.cloud.config.profile:${local.server.port:${server.port:0}}}}:${vcap.application.instance_id:${random.value}}"
I'v tryed it and It works well.
Closing as functioning properly
@spencergibb emm.... i use spring boot 2.0.6 and Finchley.SR2, /monitor does not notify Spring Cloud Config Client. SpringBoot 2.0.6.RELEASE SpringCloud Finchley.SR2
config-server https://github.com/lly835/config config-client https://github.com/lly835/config-client config-repo https://github.com/lly835/config-repo
config-repo webhooks
config log
2019-04-14 21:22:44.614 INFO 57144 --- [nio-8080-exec-1] o.s.c.c.monitor.PropertyPathEndpoint : Refresh for: order:test
2019-04-14 21:22:44.646 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1b22df5: startup date [Sun Apr 14 21:22:44 CST 2019]; root of context hierarchy
2019-04-14 21:22:44.656 INFO 57144 --- [nio-8080-exec-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-04-14 21:22:44.657 INFO 57144 --- [nio-8080-exec-1] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$30598932] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-14 21:22:44.684 INFO 57144 --- [nio-8080-exec-1] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default
2019-04-14 21:22:44.686 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3c38cf3: startup date [Sun Apr 14 21:22:44 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@1b22df5
2019-04-14 21:22:44.686 INFO 57144 --- [nio-8080-exec-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-04-14 21:22:44.690 INFO 57144 --- [nio-8080-exec-1] o.s.boot.SpringApplication : Started application in 0.073 seconds (JVM running for 268.788)
2019-04-14 21:22:44.690 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@3c38cf3: startup date [Sun Apr 14 21:22:44 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@1b22df5
2019-04-14 21:22:44.690 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@1b22df5: startup date [Sun Apr 14 21:22:44 CST 2019]; root of context hierarchy
2019-04-14 21:22:44.776 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2019-04-14 21:22:44.777 INFO 57144 --- [nio-8080-exec-1] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2019-04-14 21:22:47.781 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Unregistering ...
2019-04-14 21:22:47.786 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CONFIG/192.168.31.32:config - deregister status: 200
2019-04-14 21:22:47.791 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2019-04-14 21:22:47.792 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2019-04-14 21:22:47.804 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2019-04-14 21:22:47.804 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2019-04-14 21:22:47.804 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2019-04-14 21:22:47.804 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2019-04-14 21:22:47.857 INFO 57144 --- [nio-8080-exec-1] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-04-14 21:22:47.857 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2019-04-14 21:22:47.857 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2019-04-14 21:22:47.857 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2019-04-14 21:22:47.858 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Application is null : false
2019-04-14 21:22:47.858 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2019-04-14 21:22:47.858 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2019-04-14 21:22:47.858 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2019-04-14 21:22:47.861 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : The response status is 200
2019-04-14 21:22:47.863 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
2019-04-14 21:22:47.863 INFO 57144 --- [nio-8080-exec-1] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
2019-04-14 21:22:47.864 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1555248167864 with initial instances count: 4
2019-04-14 21:22:47.865 INFO 57144 --- [nio-8080-exec-1] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application CONFIG with eureka with status DOWN
2019-04-14 21:22:47.865 INFO 57144 --- [nio-8080-exec-1] o.s.c.n.e.s.EurekaServiceRegistry : Registering application CONFIG with eureka with status UP
2019-04-14 21:22:47.865 WARN 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1555248167865, current=UP, previous=DOWN]
2019-04-14 21:22:47.865 INFO 57144 --- [nio-8080-exec-1] o.s.cloud.bus.event.RefreshListener : Received remote refresh request. Keys refreshed []
2019-04-14 21:22:47.865 INFO 57144 --- [nio-8080-exec-1] o.s.c.c.monitor.PropertyPathEndpoint : Refresh for: order-test
2019-04-14 21:22:47.865 INFO 57144 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CONFIG/192.168.31.32:config: registering service...
2019-04-14 21:22:47.869 INFO 57144 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CONFIG/192.168.31.32:config - registration status: 204
2019-04-14 21:22:47.883 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3710026d: startup date [Sun Apr 14 21:22:47 CST 2019]; root of context hierarchy
2019-04-14 21:22:47.889 INFO 57144 --- [nio-8080-exec-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-04-14 21:22:47.890 INFO 57144 --- [nio-8080-exec-1] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$30598932] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-14 21:22:47.908 INFO 57144 --- [nio-8080-exec-1] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default
2019-04-14 21:22:47.909 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5f21ff02: startup date [Sun Apr 14 21:22:47 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@3710026d
2019-04-14 21:22:47.909 INFO 57144 --- [nio-8080-exec-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-04-14 21:22:47.911 INFO 57144 --- [nio-8080-exec-1] o.s.boot.SpringApplication : Started application in 0.045 seconds (JVM running for 272.01)
2019-04-14 21:22:47.912 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@5f21ff02: startup date [Sun Apr 14 21:22:47 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@3710026d
2019-04-14 21:22:47.912 INFO 57144 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@3710026d: startup date [Sun Apr 14 21:22:47 CST 2019]; root of context hierarchy
2019-04-14 21:22:47.970 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2019-04-14 21:22:47.971 INFO 57144 --- [nio-8080-exec-1] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2019-04-14 21:22:50.976 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Unregistering ...
2019-04-14 21:22:50.980 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CONFIG/192.168.31.32:config - deregister status: 200
2019-04-14 21:22:50.985 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2019-04-14 21:22:50.986 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2019-04-14 21:22:50.988 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2019-04-14 21:22:50.988 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2019-04-14 21:22:50.988 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2019-04-14 21:22:50.988 INFO 57144 --- [nio-8080-exec-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Application is null : false
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2019-04-14 21:22:51.036 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2019-04-14 21:22:51.039 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : The response status is 200
2019-04-14 21:22:51.039 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
2019-04-14 21:22:51.039 INFO 57144 --- [nio-8080-exec-1] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
2019-04-14 21:22:51.040 INFO 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1555248171040 with initial instances count: 4
2019-04-14 21:22:51.040 INFO 57144 --- [nio-8080-exec-1] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application CONFIG with eureka with status DOWN
2019-04-14 21:22:51.041 INFO 57144 --- [nio-8080-exec-1] o.s.c.n.e.s.EurekaServiceRegistry : Registering application CONFIG with eureka with status UP
2019-04-14 21:22:51.041 WARN 57144 --- [nio-8080-exec-1] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1555248171041, current=UP, previous=DOWN]
2019-04-14 21:22:51.041 INFO 57144 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CONFIG/192.168.31.32:config: registering service...
2019-04-14 21:22:51.041 INFO 57144 --- [nio-8080-exec-1] o.s.cloud.bus.event.RefreshListener : Received remote refresh request. Keys refreshed []
2019-04-14 21:22:51.045 INFO 57144 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CONFIG/192.168.31.32:config - registration status: 204
2019-04-14 21:27:51.043 INFO 57144 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
config-client empty log.
SpringBoot 2.0.2.RELEASE SpringCloud Finchley.RELEASE
config-server https://github.com/lly835/config config-client https://github.com/lly835/config-client config-repo https://github.com/lly835/config-repo
config-repo webhooks
config client log
see this line
matchMultiProfile : order:test:**, order:9888:adbf6adb73b0ff538091a0d3a49f8f45
9888 is configClient server port i think "order:test:adbf6adb73b0ff538091a0d3a49f8f45" is correct.see BusEnvironmentPostProcessor 55 line
should change to