1 Reply Latest reply on Jul 31, 2006 9:50 AM by bobo bibi

    [JBOSS 4] Pb Schedulers

    bobo bibi Newbie

      Hi every one,

      I don't know if it's the good group to post my problem ...
      Anyway, I have migrated from a Jboss application Server 3.0.3 release to a 4.0.3 release and i encountered some troubles in my applications.
      To give a simple example, I have severals schedulers. We can take 2 of them for example. In the release 3.0.3, the different schedulers runs independently, due to the use of distinct thread i think.

      Now with the 4.0.3 release, they run one by one. So it's a problem for me because i need them to run simulneously. I don't know how to configure that.

      Here some logs from the 3.0.3 release :



      2006-07-27 18:15:00,004 INFO [jpea.dataimport.equilend.CompareReport] [Thread-35] No remote file found
      2006-07-27 18:16:00,003 INFO [jpea.dataimport.equilend.CompareReport] [Thread-32] No remote file found
      2006-07-27 18:17:00,004 INFO [jpea.dataimport.equilend.CompareReport] [Thread-30] No remote file found
      2006-07-27 18:18:00,005 INFO [jpea.dataimport.equilend.CompareReport] [Thread-31] No remote file found


      We can notice that for each call, a different thread is used [Thread-XX]. So i suppose that a pool of thread is used here.

      Now in the 4.0.3 release, i have something like this :

      2006-07-27 18:15:35,802 INFO [jpea.dataimport.equilend.CompareReport] [Timer-2] No remote file found
      2006-07-27 18:16:35,762 INFO [jpea.dataimport.triparty.jpmorgan.JPMorganFileImporter] [Timer-2] No remote file. 0 local file(s).
      2006-07-27 18:16:35,813 INFO [jpea.dataimport.equilend.CompareReport] [Timer-2] No remote file found


      Here we can notice [Timer-2]. So when 2 process must be launched at the same time, [Timer-2] runs the first of them, and once finished, runs the second.

      Does anyone know how to configure JBOSS 4.0.3 to use different threads to run my schedulers?

      Thanks for your help

        • 1. Re: [JBOSS 4] Pb Schedulers
          bobo bibi Newbie

          For informtion, I found this warning several times :

          * ATTENTION: The scheduler instance only allows to run one schedule at a time.
          * Therefore when you want to run two schedules create to instances with this
          * MBean. Suggested Object Name for the MBean are:
          * :service=Scheduler,schedule=<you schedule name>
          * This way you should not run into a name conflict.

          So i tried to apply this recommandation, and changed my configuration file into something like this :

          <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler,schedule=CrestScheduler">
           <attribute name="StartAtStartup">true</attribute>
           <attribute name="SchedulableClass">jpea.dataimport.crest.CrestFileImporter</attribute>
           <attribute name="SchedulableArguments">import, crest_(cas|dbv)_.+\.csv$, DataimportPool, DEV</attribute>
           <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
           <attribute name="InitialStartDate">0</attribute>
           <attribute name="SchedulePeriod">300000</attribute>
           <attribute name="InitialRepetitions">-1</attribute>
           </mbean>
          

          instead of
          <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=SchedulerCrest">
           <attribute name="StartAtStartup">true</attribute>
           <attribute name="SchedulableClass">jpea.dataimport.crest.CrestFileImporter</attribute>
           <attribute name="SchedulableArguments">import, crest_(cas|dbv)_.+\.csv$, DataimportPool, DEV</attribute>
           <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
           <attribute name="InitialStartDate">0</attribute>
           <attribute name="SchedulePeriod">300000</attribute>
           <attribute name="InitialRepetitions">-1</attribute>
           </mbean>
          

          But this change has no success.
          Then I also tried to allocate a different Timer for each scheduler with a dependance like below :

          <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=SchedulerCrest">
           <attribute name="StartAtStartup">true</attribute>
           <attribute name="SchedulableClass">jpea.dataimport.crest.CrestFileImporter</attribute>
           <attribute name="SchedulableArguments">import, crest_(cas|dbv)_.+\.csv$, DataimportPool, DEV</attribute>
           <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
           <attribute name="InitialStartDate">0</attribute>
           <attribute name="SchedulePeriod">300000</attribute>
           <attribute name="InitialRepetitions">-1</attribute>
           <depends>
           <mbean code="javax.management.timer.Timer" name="jboss:service=myTimer1"/>
           </depends>
           </mbean>
          <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=SchedulerBony">
           <attribute name="StartAtStartup">true</attribute>
           <attribute name="SchedulableClass">jpea.dataimport.triparty.bony.BonyFileImporter</attribute>
           <attribute name="SchedulableArguments">import, bony_(i|d)_.+\.txt$, DataimportPool, DEV</attribute>
           <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
           <attribute name="InitialStartDate">0</attribute>
           <attribute name="SchedulePeriod">300000</attribute>
           <attribute name="InitialRepetitions">-1</attribute>
           <depends>
           <mbean code="javax.management.timer.Timer" name="jboss:service=myTimer2"/>
           </depends>
          
           </mbean>
          

          That didn't change anything...