W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
Spring Cloud提供支持以使配置參數(shù)可隨向/actuator/refresh
端點(diǎn)的POST請(qǐng)求重新加載。
Maven坐標(biāo):
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
Gradle坐標(biāo):
dependencies { compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator' }
@RefreshScope
添加到Spring配置類(lèi)中,以使參數(shù)在運(yùn)行時(shí)可重新加載。
management.endpoints.web.exposure.include=refresh
添加到application.properties
中,以允許不受限制地訪問(wèn)/actuator/refresh
。
使用gcloud
更新屬性:
$ gcloud beta runtime-config configs variables set \ myapp.queue_size 200 \ --config-name myapp_prod
發(fā)送POST請(qǐng)求到刷新端點(diǎn):
$ curl -XPOST https://myapp.host.com/actuator/refresh
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話(huà):173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: