我一直在努力尋找解決辦法,以便能夠動態讀取騾子流中的輪詢頻率。目前我正在使用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 –