0

I am currently developping an ESB (3.7.0 CE) mule application and I am using Poll component with fixed-frequency-scheduler. I would like to externalize timeUnit scheduler's attribute as below:

<poll doc:name="Poll">
<fixed-frequency-scheduler frequency="${scheduler.frequency}" timeUnit="${scheduler.timeUnit}" startDelay="${scheduler.startDelay}" />
<http:request config-ref="HTTP_RSS_Request_Configuration" path="${dmp.url.token}" method="GET" doc:name="HTTP GET RSS"/>
</poll> 

However, an exception is thrown during deployment:

2016-11-25 10:13:29,265 [Mule.app.deployer.monitor.1.thread.1] ERROR org.mule.module.launcher.application.DefaultMuleApplication - null
org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '${scheduler.timeUnit}' is not a valid value for 'NMTOKEN'.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[?:?]
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[?:?]

The explanation might be that NMTOKEN does not allow using of $, {, } which are required for defining properties. But the question is how this could be overcome.

4

1 回答 1

0

您是否在 mule config xml 中添加了上下文属性占位符?

喜欢:

<context:property-placeholder location="classpath:somefile.properties" />
于 2016-11-29T14:00:05.623 回答