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