172.8. サンプル - データベースを毎分ポーリングする
JDBC コンポーネントを使用してデータベースをポーリングする場合は、Timer や Quartz などのポーリングスケジューラーと組み合わせる必要があります。次の例では、60 秒ごとにデータベースからデータを取得します。
from("timer://foo?period=60000")
.setBody(constant("select * from customer"))
.to("jdbc:testdb")
.to("activemq:queue:customers");
from("timer://foo?period=60000")
.setBody(constant("select * from customer"))
.to("jdbc:testdb")
.to("activemq:queue:customers");