我想在启动时使用spring-cloud-config-client从spring-cloud-config-server应用程序读取我的配置属性。 我的应用程序是Spring-Boot应用程序,我需要做的是在将请求发送到配置服务器之前向请求中添加特定的标头。如何使用spring-cloud-config-client配置自定义RestTemplate?
我已阅读文档(http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html),我找不到任何方式使用提供的RestTemplate自定义ConfigServicePropertySourceLocator。
什么是最好的方法来做到这一点?
非常感谢
尝试过使用下面的要点,但它似乎属性已经被加载后@PostConstruct获取运行。是否需要某种秩序? https://gist.github.com/dwelch2344/3424b7752fbb0172ad89 –
我不确定此解答如何标记为完整,因为解决方案无效。如果达成了解决方案,用实际的解决方案更新答案将会很好。 – Ceekay