Spring Cloud Config客户端获取纯文本文件

时间:2018-06-27 09:36:54

标签: spring-boot spring-cloud spring-cloud-config

Spring云配置服务器可以提供纯文本文件,如下所述:https://cloud.spring.io/spring-cloud-config/multi/multi__serving_plain_text.html

如果我将云服务器的URL卷曲为 curl http://config.server:8001/config-server/ConfigData/default/master/plainTxtFile.json(文件在私有github存储库中。)

因此,在使用配置服务器进行配置的spring boot应用程序中,我也可以通过通过代码访问上述url来获取文件。

有没有一种方法可以定义'configClient'并将文件访问为configClient.getResource(),而不是从url获取

1 个答案:

答案 0 :(得分:0)

不,很不幸:

  

这在开源项目中未实现。

请参阅:https://github.com/spring-cloud/spring-cloud-config/issues/789