64.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>