2 Replies Latest reply on Jan 24, 2020 1:14 AM by texasaggie

    JBossAS6 Final - Quartz properties

    pi4630

      Hi,

       

      I want to specify quartz' properties at startup.

      More precisely, I'd like to define quartz properties on application specific basis (each application has its db connection user, that connection user should contain also the timer tables). I do not wat JBoss start up with a generic quartz configuration at all; applications should provide it.

       

      The first step towards this: where is the file that defines the quartz.properties for JBoss? I modified quartz.properties contained in /common/lib/quartz.jar, but evidently this is not used, as the console confirms:

       

       

      {noformat}

      11:26:55,903 INFO  [SchedulerSignalerImpl] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl

      11:26:55,904 INFO  [QuartzScheduler] Quartz Scheduler v.1.8.3 created.

      11:26:55,906 INFO  [RAMJobStore] RAMJobStore initialized.

      11:26:55,909 INFO  [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v1.8.3) 'JBossQuartzScheduler' with instanceId 'NON_CLUSTERED'

        Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.

        NOT STARTED.

        Currently in standby mode.

        Number of jobs executed: 0

        Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.

        Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

       

      11:26:55,909 INFO  [StdSchedulerFactory] Quartz scheduler 'JBossQuartzScheduler' initialized from an externally opened InputStream.

      11:26:55,909 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.8.3

      {noformat}

       

      I'm following the Quartz documentation here, but confused about  if the .properties should be used, rather than a service xml.

       

      Thanks,

      ~pasquale

        • 1. Re: JBossAS6 Final - Quartz properties
          piyushgoel996

          You can make your own quartz.properties file and locate it in classpath of your project to get it be picked. If you want quartz.properties file per application basis then you'll have to make quartz.properties file for each project.

           

          And moreover as you said that but evidently this is not used, as the console confirms:...
          Make it more clear how can you say its not getting used because nothing can be seen in the logs pasted above.

          • 2. Re: JBossAS6 Final - Quartz properties
            texasaggie

            I implemented this with a singleton (@Singleton) class that is annotated for @Startup and initializes quartz using a properties file embedded within the JAR file. I have a different build for each server that includes the properties file in the classpath of the JAR file so I have no external references out of the JAR files. I then reference it something akin to this in the startup class:

             

            scheduler = new StdSchedulerFactory("conf/quartz.properties").getScheduler();

            scheduler.start();

             

            This will initialize my scheduler instance and start it up when the application is deployed.