-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ApolloConfigChangeListener 无效 #51
Comments
Spring Boot version? run mvn dependency:tree > tree.log get it. |
2.1.5.RELEASE |
@RefreshScope 如果使用这种方式虽然可以动态更新了,但是会导致eureka 注册当前服务进行先down 在 up操作。 |
You could refresh the specific bean with the bean name, e.g. |
BTW, I verified EnvironmentChangeEvent also works in spring boot 2.4.12 and spring cloud 2020.0.4. If it doesn't work for your scenario, please take a look at your ConfigurationProperties setup and make sure it is not annotated with |
恩,是我只写取application错误了,请问@RefreshScope 会导致服务重启的问题您遇过吗? |
@Sam0913 You need to refresh a specific bean instead of refresh all. But I think even refresh all will only trigger eureka to unregister and register itself but won't restart the service. |
`
@slf4j
@component
public class ApolloConfig implements ApplicationContextAware {
}
`
这边能取到最新配置,但是使用@ConfigurationProperties(prefix = "spring.datasource")的配置还是久的值
The text was updated successfully, but these errors were encountered: