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