Apollo使用文档,Java

1、apolo的github上的文档很全,大家可以去github上查看下面是java客户端使用文档

https://github.com/ctripcorp/apollo/wiki/Java%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97

2、公司apollo

登录地址:http://config.homedo.com

账号:demo

密码:123456

3、我这边写了个demo(spring和springBoot对接apollo的简单demo)

代码地址:git@gitlab.homedo.com:microservice/apollo-demo.git

java在使用过程中如果使用@ConfigurationProperties的时候需要注意一下(修改值自后不会自动变更)

@ConfigurationProperties如果需要在Apollo配置变化时自动更新注入的值,需要配合Spring Cloud的RefreshScope使用。相关代码实现,可以参考apollo-demo项目中的SampleRedisConfig.javaSpringBootApolloRefreshConfig.java

对apollo的版本进行了升级

如果客户端要升级的话 把原来apollo-client的依赖改一下,改成如下就可以了

<dependency>
<groupId>com.homedo</groupId>
<artifactId>homedo-apollo-client</artifactId>
 <version>2.1.1</version>
</dependency>