[jboss-user] [Management, JMX/JBoss] - How do you run multiple schedules (mbeans)? What am I doing

smitjel do-not-reply at jboss.com
Wed Jul 30 16:40:51 EDT 2008


I need the ability to run multiple schedules (scheduled mbeans, both able to run at the same exact time) on Jboss 4.0.5/JDK5.  I reviewed the Scheduler javadocs (http://docs.jboss.org/jbossas/javadoc/4.0.5/varia/org/jboss/varia/scheduler/Scheduler.html) and it specifically states:anonymous wrote : Scheduler Instance to allow clients to run this as a scheduling service for any Schedulable instances.
  | 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=
  | This way you should not run into a name conflict.
I'm almost positive I've done what is recommended to run multiple schedules.  Here is what the jmx-console says (among other things) about my scheduled mbeans I've created in a deployed SAR:anonymous wrote : name=MQLoaderA
  | name=MQLoaderB
  | name=MQLoaderC
  | schedule=MQLoaderA,service=Scheduler
  | schedule=MQLoaderB,service=Scheduler
  | schedule=MQLoaderC,service=Scheduler
  | service=ScheduleManager
  | service=Timer
Here is what my jboss-service.xml looks like for these mbeans:<mbean code="com.titanium.business.scheduler.Loader" name=":name=MQLoaderA"></mbean>
  | 
  | <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler,schedule=MQLoaderA">
  |    <depends>jboss:service=ScheduleManager</depends>
  |    <depends>jboss.j2ee:service=EJB,jndiName=titanium/MQLoaderMap</depends>
  |    <attribute name="StartAtStartup">true</attribute>
  |    <attribute name="SchedulableMBean">:name=MQLoaderA</attribute>
  |    <attribute name="SchedulableMBeanMethod">doIt()</attribute>
  |    <attribute name="InitialStartDate">1/1/08 1:00 am</attribute>
  |    <attribute name="SchedulePeriod">3600000</attribute>
  |    <attribute name="InitialRepetitions">-1</attribute>
  |    <attribute name="FixedRate">true</attribute>
  | </mbean>
  | 
  | <mbean code="com.titanium.business.scheduler.Loader" name=":name=MQLoaderB"></mbean>
  | 
  | <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler,schedule=MQLoaderB">
  |    <depends>jboss:service=ScheduleManager</depends>
  |    <depends>jboss.j2ee:service=EJB,jndiName=titanium/MQLoaderMap</depends>
  |    <attribute name="StartAtStartup">true</attribute>
  |    <attribute name="SchedulableMBean">:name=MQLoaderB</attribute>
  |    <attribute name="SchedulableMBeanMethod">doIt()</attribute>
  |    <attribute name="InitialStartDate">1/1/08 1:00 am</attribute>
  |    <attribute name="SchedulePeriod">3600000</attribute>
  |    <attribute name="InitialRepetitions">-1</attribute>
  |    <attribute name="FixedRate">true</attribute>
  | </mbean>
  | 
  | <mbean code="com.titanium.business.scheduler.Loader" name=":name=MQLoaderC"></mbean>
  | 
  | <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler,schedule=MQLoaderC">
  |    <depends>jboss:service=ScheduleManager</depends>
  |    <depends>jboss.j2ee:service=EJB,jndiName=titanium/MQLoaderMap</depends>
  |    <attribute name="StartAtStartup">true</attribute>
  |    <attribute name="SchedulableMBean">:name=MQLoaderC</attribute>
  |    <attribute name="SchedulableMBeanMethod">doIt()</attribute>
  |    <attribute name="InitialStartDate">1/1/08 1:00 am</attribute>
  |    <attribute name="SchedulePeriod">3600000</attribute>
  |    <attribute name="InitialRepetitions">-1</attribute>
  |    <attribute name="FixedRate">true</attribute>
  | </mbean>
These MBeans are configured to fire at the same exact time (on the hour) but they don't; they run one after the other.  Did I not name the schedules correctly like the javadocs suggested?  This worked perfectly on JBoss 3.2.6 so I'm a little confused.  I appreciate any help with this.  Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167746#4167746

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167746



More information about the jboss-user mailing list