在config-dev.properites文件中写入以下内容:
app.version=dev
message=Spring Cloud Config
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
server.port=50028
在config-pro.properties文件中写入以下内容:
app.version=pro
message=Spring Cloud Config
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
server.port=50029
{"name":"config","profiles":["dev"],"label":null,"version":"00f8179acc9ad109abc114309d8e46a0b032aa14","state":null,"propertySources":[{"name":"https://github.com/lingfengxeon/spring-config/config-dev.properties","source":{"app.version":"dev","message":"Spring Cloud Config","spring.rabbitmq.host":"localhost","spring.rabbitmq.port":"5672","spring.rabbitmq.username":"guest","spring.rabbitmq.password":"guest","server.port":"50028"}}]}
{"name":"config","profiles":["pro"],"label":null,"version":"00f8179acc9ad109abc114309d8e46a0b032aa14","state":null,"propertySources":[{"name":"https://github.com/lingfengxeon/spring-config/config-pro.properties","source":{"app.version":"pro","message":"Spring Cloud Config","spring.rabbitmq.host":"localhost","spring.rabbitmq.port":"5672","spring.rabbitmq.username":"guest","spring.rabbitmq.password":"guest","server.port":"50029"}}]}
访问:http://localhost:50027/config-dev.properties
app.version: dev
message: Spring Cloud Config
server.port: 50028
spring.rabbitmq.host: localhost
spring.rabbitmq.password: guest
spring.rabbitmq.port: 5672
spring.rabbitmq.username: guest
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有