惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
P
Palo Alto Networks Blog
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
AWS News Blog
AWS News Blog
J
Java Code Geeks
博客园_首页
Scott Helme
Scott Helme
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
V
Visual Studio Blog
Cloudbric
Cloudbric
Jina AI
Jina AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
The Last Watchdog
The Last Watchdog
SecWiki News
SecWiki News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
W
WeLiveSecurity
K
Kaspersky official blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hacker News: Ask HN
Hacker News: Ask HN
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
量子位
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 三生石上(FineUI控件)
Recent Commits to openclaw:main
Recent Commits to openclaw:main

博客园 - 后端AI实验室

我带的那个实习生,比我更依赖AI——但他的问题和我完全不同 我用AI把一个外包需求从30天压到5天交付,然后客户说:下次还找你 我用 AI 设计了一套新人 onboarding 方案,两周后他的产出超出了我的预期 AI编程一年后,我还记得怎么手写代码吗?答案让我沉默了 裁员后我被迫负责运维,用AI从0搭建了可观测性平台 我把代码审查权交给AI两个月,团队发生了什么 等保三级整改,敏感数据加密,数十个系统——3个人用Cursor一周搞定了 我让AI模拟面试官考了我一个小时,然后我沉默了 同一个需求,我先出技术方案,再让AI出方案——差距让我沉默了 3年没人敢碰的老代码,我用AI重构了它——然后翻车了 我让AI review了自己写的代码,然后删掉了30% 我把一个生产Bug的排查过程,交给AI处理——20分钟后我关掉了它 我把同一个需求分别交给初级程序员、高级程序员和AI,结果让我沉默了 用AI写代码,我差点把漏洞发上线:血泪总结的10个教训 我用Cursor开发了3个月,整理出这套提效4倍的工作流 IntelliJ IDEA的统治即将终结?我已经3个月没怎么用它了 公司给团队配了Cursor,然后开始裁员:一个残酷但必须面对的真相 黄仁勋说编程只是打字?一个12年老程序员的冷静思考 springcloud-nacos配置中心 springcloud-nacos服务注册 springcloud-bus消息总线
springcloud-configclient手动刷新
后端AI实验室 · 2020-08-20 · via 博客园 - 后端AI实验室

1.依赖

 <!--引入consul-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-discovery</artifactId>
        </dependency>
        <!--引入健康检查-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

 2.配置文件

application.properties

server.port=9991
spring.application.name=configclient

spring.cloud.consul.host=localhost
spring.cloud.consul.port=8500
spring.cloud.consul.discovery.service-name=${spring.application.name}

management.endpoints.web.exposure.include=*

name=${name}

 bootstrap.properties

spring.cloud.config.name=sem
spring.cloud.config.profile=pro
spring.cloud.config.uri=http://127.0.0.1:9999/
spring.cloud.config.label=

 3.启动注解

@SpringBootApplication
public class ConfigclientApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigclientApplication.class, args);
    }

}

 4.controller

@RestController
@RefreshScope
public class TestController {
    @Value("${name}")
    private String name;

    @RequestMapping("/test")
    public String hello() {
        return name;
    }
}

 5.刷新

SVN配置文件修改提交后,configclient需要post发送刷新请求 URL:http://127.0.0.1:9991/actuator/refresh,再次访问带有@RefreshScope注解的controller配置文件修改后的值才能被重新加载。