apollo 集成springboot没法热更新? - SegmentFault 思否

最近通过Apollo来搭建配置中心,在配置数据库的时候,在Apollo上面更改了数据库的连接信息后程序需要重启才能生效

pom.xml 文件
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>com.ctrip.framework.apollo</groupId>
        <artifactId>apollo-client</artifactId>
        <version>1.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
        <scope>true</scope>
    </dependency>
application.yml 文件

app:
id: first-test
apollo:
meta: http://127.0.0.1:8080/
autoUpdateInjectedSpringProperties: true
bootstrap:

enabled: true
namespaces: database

env: DEV

spring:
datasource:

driver-class-name: com.mysql.jdbc.Driver
username: ${name}
password: ${password}
apollo配置

clipboard.png


原网址: 访问
创建于: 2022-04-13 10:25:12
目录: default
标签: 无

请先后发表评论
  • 最新评论
  • 总共0条评论