【发布时间】:2015-01-04 06:58:59
【问题描述】:
我一直在努力寻找能够动态读取 mule 流中的轮询频率的解决方法。目前我在启动时使用spring的Propertyplaceholder从文件中读取它,即使fie被更改,值也保持不变(众所周知)..
由于 poll 标记需要成为流程中的第一个组件,我无法读取“实时”文件更新。
有什么方法可以设置从文件动态读取的轮询频率(无需重新启动)?
供参考:
<spring:beans>
<context:property-placeholder location="file:///C:/Users/test/config.properties" />
</spring:beans>
<flow name="querying-database-pollingFlow1" doc:name="querying-database-pollingFlow1">
<poll doc:name="Poll3e3">
<fixed-frequency-scheduler frequency="${pollinginterval}"/>
<db:select config-ref="MySQL_Configuration1" doc:name="Perform a query in MySQL">
<db:dynamic-query><![CDATA[select empId,empName from employer where status='active';]]></db:dynamic-query>
</db:select>
</poll>
....</flow>
【问题讨论】:
-
顺便说一句,我还尝试查看一些侦听文件并获取值的东西。 1)首先,我不知道这是否正确 2)我不确定如何覆盖属性占位符的属性值映射并在场景后面更新新值(只需从文件中读取)以便骡子可以使用更新值以确定轮询频率。
-
对于未来的读者,这是一个快速的答案:接受的答案是进行热部署,尽管它在产品服务器中不是一个好主意。另一个建议是使用 JMX