44.7. 例
60 秒ごとにイベントを生成するルートを設定するには、以下を実行します。
from("scheduler://foo?delay=60000").to("bean:myBean?method=someMethodName");
from("scheduler://foo?delay=60000").to("bean:myBean?method=someMethodName");
上記のルートはイベントを生成し、JNDI や Spring などのレジストリーの myBean
という Bean で someMethodName
メソッドを呼び出します。
Spring DSL のルートは以下のようになります。
<route> <from uri="scheduler://foo?delay=60000"/> <to uri="bean:myBean?method=someMethodName"/> </route>
<route>
<from uri="scheduler://foo?delay=60000"/>
<to uri="bean:myBean?method=someMethodName"/>
</route>