2 Replies Latest reply on Nov 13, 2013 11:08 AM by tcunning

    ¿Can a scheduler be configured out of the jboss-esb.xml file?

    pawer13

      Hi,

       

      I'm trying to create a service triggered by a scheduler, so I have something like this in my jboss-esb.xml file:

       

      <schedule-provider name="schedule">
        <!--fired every 5 minutes -->
        <cron-schedule cronExpression="0 0/5 * * * ?" scheduleid="cron-trigger" />
      </schedule-provider>
      

       

      My problem is our client wants to be able to change the periodicity of the execution, even if he has to restart the server, but without modifying the ESB file (no redeploys).

      There are more parameters that he wants to be modifiable, but as they are part of our logic I can add them in any properties or XML file, but I can't figure how to solve this one.

      Any hint?

       

      Thanks in advance

        • 1. Re: ¿Can a scheduler be configured out of the jboss-esb.xml file?
          pawer13

          It seems there is no way to do that, so I've solved this issue using a different approach: I added a properties file that is read by my listener (which extends ScheduledEventMessageComposer) to set the number of minutes between each execution and I set the trigger every minute. if the number of minutes is not correct, the trigger is just ignored.

          • 2. Re: ¿Can a scheduler be configured out of the jboss-esb.xml file?
            tcunning

            Pablo, I believe you're right on both counts.     Nice work!

             

            If you wanted to even take it another step further, you could have your listener get the values from an MBean.      That'd allow the someone to change the MBean settings in jmx-console, and then restart your listener - the period could be reconfigured without even a server stop/start.     Also, if you want to see that functionality in the ESB, feel free to log a JIRA on it, I think that's something that would help others as well.