我想在啓動時使用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