0 Replies Latest reply on Aug 30, 2006 6:02 AM by Andre Nogueira

    Have scheduler depend on queue

    Andre Nogueira Newbie


      I'm new to Jboss, so I'm still having some problems.. Hopefully you'll be able to help me :-)

      I currently have a scheduler which checks for new email messages on a POP server. When a new message arrives, it places a message on a queue.
      The Scheduler and the queue are part of two different .ear files, since the queue is used by several services.

      As such, I wanted to make sure the scheduler doesn't start until the queue is created. How can I accomplish this?
      I probably have to use the "depends" tag on the scheduler's jboss-service.xml file, but what do I have to put inside it?

      I can't find this anywhere on the internet... Maybe I didn't search for the correct keywords..?

      Here are the jboss-service xml snippets of the queue and of the scheduler:

      <mbean code="org.jboss.mq.server.jmx.Queue" name="com.test.mycomponent.shared:service=Queue,name=inMessages">
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>

      <mbean code="org.jboss.varia.scheduler.Scheduler"
       <!-- StartAtStartup should be false so it only runs when schedulabled -->
       <attribute name="StartAtStartup">true</attribute>
       <attribute name="SchedulableClass">
       <!-- set precise date to schedule to precise time of day -->
       <attribute name="InitialStartDate">0</attribute>
       <!-- run every 24h -->
       <attribute name="SchedulePeriod">1000</attribute>
       <!-- run forever -1 -->
       <attribute name="InitialRepetitions">-1</attribute>

      Thank you in advance!