The QuartzComponent integrates with the Quartz open source scheduler library. This allows ServiceMix to trigger service invocations at timed intervals to perform periodic tasks.
Here's an example of configuring a quartz component. You can add as many triggers as you wish to the component, at different timing intervals.
<sm:activationSpec componentName="timer" service="my:timer" destinationService="my:receiver">
<sm:component><bean class="org.apache.servicemix.components.quartz.QuartzComponent">
<property name="triggers">
<map>
<entry>
<key>
<bean class="org.quartz.SimpleTrigger">
<property name="repeatInterval" value="200"/>
<property name="repeatCount" value="20"/>
</bean>
</key>
<bean class="org.quartz.JobDetail">
<property name="name" value="My Example Job"/>
<property name="group" value="ServiceMix"/>
</bean>
</entry>
</map>
</property>
</bean></sm:component>
</sm:activationSpec>
Notes:
- The SimpleTrigger repeatCount value count is starting at zero, meaning repeatCount=0 triggers once, repeatCount=1 triggers twice etc. (Quartz v1.5)
- Maybe properties like description or durability are interesting for you - for further details refer to the Quartz project JobDetail JavaDoc API.
A number of properties can be configured on the component: