国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
springcloud(第二篇)springcloud config 修改配置


Git端修改配置后如何讓客戶端生效?

訪問(wèn)接口修改

  • refresh
    post方式執(zhí)行http://localhost/refresh 會(huì)刷新env中的配置
  • restart
    如果配置信息已經(jīng)注入到bean中,由于bean是單例的,不會(huì)去加載修改后的配置
    需要通過(guò)post方式去執(zhí)行http://localhost/restart,
    需要通過(guò)application.properties中配置endpoints.restart.enabled=true啟動(dòng)指定的端口

弊端: 通過(guò)restart耗時(shí)比較長(zhǎng),因此就有了RefreshScope

RefreshScope

package com.lkl.springcloud.config.client;import org.springframework.beans.factory.annotation.Value;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.EnableAutoConfiguration;import org.springframework.cloud.context.config.annotation.RefreshScope;import org.springframework.context.annotation.ComponentScan;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * Created by liaokailin on 16/4/28. */@EnableAutoConfiguration@ComponentScan@RestController@RefreshScopepublic class Application {    @Value("${name:World!}") String name ;    @RequestMapping("/")    public String home(){        return "Hello " + name;    }    public static void main(String[] args) {        SpringApplication.run(Application.class,args);    }}

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
【安全鑒權(quán)】Spring Boot Actuator如何進(jìn)行安全鑒權(quán)?還得是這樣。
Spring Cloud 中使用zookeeper作為服務(wù)注冊(cè)中心與配置中心
SpringCloud第四篇:熔斷器Hystrix
33、springboot整合springcloud
spring-boot(九)websocket配置
跨域請(qǐng)求設(shè)置
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服