I'm looking for the simplest thing that could possibly work to schedule a simple job - a job which doesn't interact with any other ESB component. [Go easy on me as this my first hour in ESB-land.]
I get the bit about having a cron-scheduler
producer. It appears to be deliciously simple if you're familiar with cron
:
<providers>
<schedule-provider name="schedule">
<cron-schedule scheduleid="cron-trigger" cronExpression="0/1 * * * * ?" />
</schedule-provider>
</providers>
Next there is a listener (referencing the producer) to handle the scheduled events
<services>
<service category="ServiceCat" name="ServiceName" description="Test Service">
<listeners>
<scheduled-listener name="cron-schedule-listener"
scheduleidref="cron-trigger"
event-processor="org.example.MyListener" />
</listeners>
</service>
</services>
Given that my job action isn't going to send any messages, or need to notify anything regarding success or failure. could I simply extend ScheduleListener
and override the onSchedule()
method and implement my job execution there without creating an action?
Even if this were possible, would there be any benefit for using an action for this simple pattern?
I'm using JBoss ESB 4.9.
Another way of doing this is to implement the org.jboss.soa.esb.schedule.ScheduledEventListener class.
As such your jboss-esb.xml would look like so:
And then your com.myCompany.esb.myDaemon.main.MyDaemonScheduledEventListener would look like:
So when you deploy this, it will cause the onSchedule() to run every minute.