繁体   English   中英

Spring Cloud Config客户端在属性文件中设置配置URL

[英]spring cloud config client set config url at property file

我有一个Spring Cloud项目。 有配置服务器(config-srv),尤里卡服务器(eureka-srv)和其他带有业务逻辑的服务,我们称其为主服务(main-srv)。

我将它们包装到广口瓶中,然后逐一运行。 我的应用程序从与jars相同目录中的文件获取属性。

因此,我通过“ application-native.properties”将属性设置为config-srv。

但是,如果我想更改config-srv URL(例如,我想要http:// localhost:9999 ),我如何在所有微服务启动之前为所有微服务共享此URL? 我正在尝试在“ application-default.properties”中共享此网址,但没有任何效果。

您可以将Spring Cloud Config服务器详细信息放在每个微服务的bootstrap.properties文件中。

spring.application.name=microserviceName
spring.profiles.active=dev
spring.cloud.config.uri=http://localhost:9999
spring.cloud.config.username=your_username
spring.cloud.config.password=your_password

浏览链接以获取有关Spring Cloud Config的更多详细信息https://howtodoinjava.com/spring-cloud/spring-cloud-config-server-git/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM