We help IT Professionals succeed at work.

CRON Processes and JMS Queues

919 Views
Last Modified: 2014-05-27
Just trying to get me head wrapped around how CRONS works and how it interacts with other components like JMS Queues and Quartz.  

I see that the CRON batch file contains a list processes and an expression that defines the condition for running the expression.  Do each of the processes correspond to a JMS Queue?  So when the CRON expression I TRUE, the data for the CRON process will be sent to JMS Queue.   My questions are:

1. Do each of the CRON processes correspond to a JMS Queue?
2. If not, how and where do you define this relationship?

For example;

CRON Process                                          Expression                 My Notes
---------------------                                          ---------------                  -------------
RemoveexpiredAccounts                       000**?                         This process will extract data and send to JMS
                                                                                                         Queue of the same name?

UpdateTagsonAllAccounts                    003**?                          This process will extract data and send to JMS
                                                                                                         Queue of the same name?
Comment
Watch Question

application manager
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi, can you confirm this it the correct link.  I cannot open and I would really like to see it.
Surranoapplication manager

Commented:
Strange, I cannot open it either.
Let's try later.

Author

Commented:
Hi Surrano,

First thank you for your answers.   Next can you please confirm my understanding below.   Just need to understand all the pieces involved with running a process on a JBoss server.  The setup we have is CRON embedded with JBoss Quartz.  We also have ETL's scheduled through task scheduler at the operating level and they have some parts of the jobs that run.

1. JBoss Quartz batch file contains scheduling detailing including some CROM expressions.   This must also  
    contain listeners.
2. JBoss application server runs this file every few minutes to see if it is time to run a processes listed in the
    Quartz batch file.  
3. When a process runs it will send a file to the JMS Queue.  Let's say I am running a processes that needs to
    close all accounts.  The process will call SQL Command to extract the accounts to be closed.
     a. What type of file is actually sent to the JMS Queues?
     b. Is it a file containing instructions on how to run the process?
     c. Is it a file containing logs or messages from the process?
4. Log4j.  We are using Log4j for logging.
    a.  I am assuming something must be coming from the JMS Queues like a message containing the status of the job.
5. Any my missing anything else to complete the high level picture.
Surranoapplication manager

Commented:
1. In the versions of JBoss we use, there are no batch files. There are configuration xml files for each particular job.

2. The directory of scheduler job xml files is checked periodically for changes but it's not really the file that is checked whether it's time to run. It is the database. The files are only used to update the QRTZ_* tables in the database, and only if override-existing-jobs property is set to true in the file.

3. Consequently, when a job is triggered (I don't like the phrase "process runs" since there is one process only; the jboss vm itself) it won't send any file anywhere. It will start a job which is typically invoking a given method of a given classname. What that class method does is undefined. It may use JMS or Log4J or whatever.

4. Depending on the configured log level of job classes, you may see entries like:

2013-12-30 15:02:00,831 INFO  (User) MyQuartzScheduler_Worker-7 [my.scheduler.jobs.MyBigJob] MyBigJob: 18000 records processed. 

Open in new window


5. I'm pretty sure you have the generic picture :)

By the way the link seems to be alive at the moment.

Author

Commented:
Hi S,

I promise last questions.   So I have a application property file that contains Jobs and a CRON expression like shown below (i added the xxxxx for security reasons).   The process below read data from a SQL Server Database and there are probablly XML files associated with each of these Jobs.  

xxxxxxCronTrigger.cronExpression=0 0 0 * * ?
xxxxxxxUpdateCronTrigger.promiseEndOfDayCutOffHour=20
xxxxxxxSuppresionTrigger.cronExpression=0 0 5 * * ?

Here is all I want to know:

1. This proerty file must be set up in JBoss Quartz Jobs somewhere so that the Jboss server can check the Job expression to see if it is time for the Job to run.  Is my understanding Correct?  

2.  JMS Queues.  This is the part I do not understand.  What is being sent to the JMS queues and for what purpose?  Is JMS doing the same thing as Log4j?

Sorry for all the questions and I promise I will not ask anyone on this ticket.
Surranoapplication manager

Commented:
1. Not sure about the details but the scheduler's input dir can be specified in JMX. I'll dig up the exact key till Monday if you need it.

2. JMS and Quartz have little in common. They are basically two completely different things; but interestingly, someone has already asked this on another expert site about two years ago.  
If you need a crash course on JMS (which is a specification, not an implementation) start here
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.