问题描述
在我的仓库中,有三个文件:config-client-dev.properties
,config-client-prod.properties
和config-client.properties
。
我使用像这样的卷曲:
curl http://localhost:8888/config-client/dev/master
curl http://localhost:8888/config-client/prod/master
curl http://localhost:8888/config-client/default/master
我得到的结果是:
{“名称”:“配置客户端”,“配置文件”:[“产品”],“标签”:“主机”,“版本”:null,“状态”:null,“ propertySources”:[] }
解决方法
您的结果
curl http://localhost:8888/config-client/dev
curl http://localhost:8888/config-client/prod
curl http://localhost:8888/config-client/default
这是错误的。您必须致电
master
(删除分支ZlibDecoder
的名称)
让我们看一下参考文档中的一个示例:https://docs.spring.io/spring-cloud-config/docs/2.2.5.RELEASE/reference/html/#_quick_start