Spring cloud配置和xml配置

时间:2017-04-21 01:52:32

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

这里给出的例子 https://spring.io/guides/gs/centralized-configuration/

在Java文件中使用RestController时可以正常工作,包括刷新属性。但是,当我在 xml文件中注入属性时,它无法识别该属性。

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'exchange' in value "${exchange}"
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
    at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)

配置:

<int-amqp:outbound-channel-adapter
      channel="getAccount" amqp-template="amqpTemplate" exchange-name="${exchange}"
      routing-key="facade.listener.key" mapped-request-headers="http_requestUrl,X-B3-TraceId,X-B3-SpanId,X-Span-Name" />

GIT存储库中的proprties文件是

exchange=trace.log.topic

spring boot和spring cloud配置是否也支持xml变量注入?

0 个答案:

没有答案