TWO COOL: Java Technology Powers a Pair of Cool Applications
Sims Computing’s Flux Enterprise Job Scheduler
Computer job scheduling has been with us since 1960s-era mainframe systems, and was later more well established by the Unix(r) platform’s cron facility. In a nutshell, job scheduling is simply a matter of executing the correct task, on the correct day, and at the correct time. But in an era where computational systems have moved light-years beyond 1960s applications such as payroll processing, job scheduling has also become far more diverse — and far more critical.
“Today, there’s more to job scheduling than running disk backups at 3 A.M.,” says David Sims, President of Sims Computing. “Customer relationship management applications need to contact customers at defined periods in the sales cycle, file transfer applications need to transmit and receive files at regular intervals (and be aware of holidays), and administrative applications need to send email reminders to various groups and sub-groups of employees and customers. All of these functions can benefit from a reliable, full-featured enterprise job scheduler.”
Sims Computing, a Montana-based software company, had regularly been incorporating scheduling functionality into various applications developed for its customers. Having utilized JavaTM technology since 1997, the company soon recognized the need for a general full-featured scheduling application to be used with Java technology. And thus was born Flux, a scheduling software component that is written entirely in the Java language, providing sophisticated job scheduling functionality to Java 2 Platform, Standard Edition (J2SETM) and Enterprise Edition (J2EETM) applications.
Benefits of Java Technology
For a facility like Flux, which targets the scheduling needs of diverse systems, cross-platform compatibility is of the utmost importance. “I can say with confidence that we could not have developed this product without Java technology,” says Sims. “We have customers that are running on the obvious platforms, like Solaris or Windows. But then there are also platforms like HP-UX, AIX, and Linux. We’ve even had inquiries from people running on IBM mainframes that have a virtual machine for the Java Platform (“Java virtual machine” or “JVMTM”). And that’s really all that matters. ‘Write Once, Run AnywhereTM’ works for us. We develop and compile on one system, and test on others. But we can’t test them all. As long as it’s got the JVM, and the Java DataBase Connectivity (JDBCTM) driver for the database, they can use Flux.”
Flux offers a sophisticated set of scheduling features. A job can be scheduled to execute one time only — for example, at 4 AM, July 4th, 2007, or 90 days from the current time. More commonly, jobs can be scheduled to execute periodically, whether indefinitely, until an ending date, or for a fixed number of repetitions. One job might be scheduled to run at 6 AM on the second Tuesday of every month. Another might be scheduled to run at 8:15 AM and 5:15 PM, Mondays through Fridays. A third job might be scheduled to run every 750 milliseconds.
Recent releases of Flux allow scheduling using cron-like formatting, but offering far greater granularity than cron (milliseconds) and providing more sophisticated date calculations.
The level of concurrently scheduled Flux jobs can also be configured. A concurrency level of 1 allows at most one job to be fired at any one time. But a concurrency level of 50 permits up to 50 jobs to fire simultaneously. Adjusting the level of concurrency allows system resources to be conserved.
Any number of jobs can be added to any number of queues on a first-come, first-serve or a priority basis. Flux can accommodate hundreds of thousands of jobs — with each job fired at the appropriate time.
Flux also provides for clustering and failover. A Flux scheduler instance is typically installed on each system in a clustered environment. Should any instance go down or become inaccessible, failover allows the remaining Flux instances to take over the duties of the failed or inaccessible instance and continue scheduling jobs.
Under the Hood
Written entirely in the Java language, Flux can be used as a job scheduling component in any J2EE or J2SE technology-based application. Flux integrates tightly with J2EE platform applications, invoking Enterprise JavaBeansTM (EJBTM) session beans, sending Java Message Service (JMS) messages, and invoking message-driven beans. But the facility can also simply be used inside of a servlet, or even within a standalone application. “There are many different scenarios in which people choose to deploy Flux,” says Sims. “And it can also be used to spawn off synchronous or asynchronous native processes.”
Meanwhile, Flux is application server independent. “It doesn’t require an application server,” says Sims, “but if one is there, it can take advantage of it. Flux has been tested against the BEA WebLogic, IBM WebSphere, Borland AppServer, SilverStream eXtend, Sybase EAServer, iPlanet, Orion, JBoss, J2EE platform Reference Implementation, and Macromedia JRun application servers.”
Flux jobs gain persistence via a relational database — jobs needn’t be re-scheduled or re-queued simply because Flux is restarted. “All that’s required is a JDBC driver,” says Sims. “It’s been tested against Oracle, IBM DB2, Microsoft SQL Server and Access, Sybase ASA and ASE, Informix and Informix Cloudscape, HSQL, and TimesTen databases.”
Because application servers are good at load balancing, Flux can take advantage of this ability to provide load balancing of its job scheduling. An EJB component session bean listener is simply registered, and when a job fires, Flux creates and calls the session bean. The application server can then balance the session beans over a cluster of servers in order to achieve the desired load balancing.
The recently released Flux 3.1 also supports XML. With XML scheduling, jobs can be defined in XML, and submitted to the scheduler for execution. Scheduled jobs can also be retrieved from the scheduler formatted in XML.