我一直在努力寻找解决办法,以便能够动态读取骡子流中的轮询频率。目前我正在使用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)我不知道如何覆盖propertyplaceholder的属性值映射并更新场景后面的新值(只是从文件中读取),以便mule可以使用更新的值来确定轮询频率。 –
对于未来的读者,下面是快速回答:接受的答案是做热部署,虽然它不是一个好主意在prod服务器。其他建议是使用JMX –