Java Scheduling with Redwood CronacleBeans

We have been working with Redwood Software’s CronacleBeans technology for about the last year now and I would like to try and start spreading the good word about this most useful piece of technology.

CronacleBeans comes as part of the Cronacle Enterprise Scheduler suite of software and allows full integration between the Java world and the enterprise scheduling world. What made CronacleBeans interesting for us was the fact that our development teams could develop Java based services (POJOs, EJBs, whatever) and then, via a simple API (the heart of Cronacle is built on PL/SQL but Redwood provide a Java API which maps directly to the PL/SQL API), make them enterprise scheduler executable jobs.

Any decent enterprise scheduler must provide a core set of functionality, for example:

  • Schedule jobs (doh!)
  • Manage job dependencies
  • Manage queueing
  • Manage job prioritization
  • Manage job status
  • React to changes in job status e.g. errors, completions, unknowns etc.
  • Start, stop, restart
  • Concurrent job processing
  • Notification

Its not impossible to construct your own Java scheduler, but to be honest, while you’re spending your time bringing together a set of libraries to do any of the above, or develop and test a home grown solution, your customers core business requirements are not being satisfied. When you use Cronacle and CronacleBeans you get all of the above out of the box. You do not have to concern yourselves with the mechanics of scheduling and how to implement some of its concepts in the Java world. You get to concentrate on what you were hired to do in the first place: solve some business problem for your customer.

Relatively simple schedulers like Cron can do a fine job of scheduling ‘kick-offs’ for command line driven applications, but we know that you get greater performance from long running java processes that have natively compiled all the hotspots in your application. Generally, processes like this would be started with the -server option enabled in your Java options and would process work over a long period of time.

CronacleBeans can be ran in two different modes:

  • In-container: running inside a J2EE container
  • Standalone

We happen to have a number CronacleBeans instances running inside a number of Oracle OC4J 10g instances (for ease of configuration) but it could just as easily be running as a standalone Java process. The CronacleBeans instance listens to the Network Agent for any work that may be assigned to it, and when a a job is invoked, either in an ad-hoc, scheduled or event driven manner, the agent will stream the necessary Java job definitions in the CronacleBeans instance.

A Java job definition is, at its most basic, a Java class, that implements a Redwood Executable interface and has some XML embedded in the source that can be picked up and read by the Redwood ANT tasks that convert the Java class into a Cronacle readable set of files. Redwood provide a number of ANT tasks that are necessary for script generation, compilation and eventual deployment to the script repository. The development approach required is quite easily setup in a JDeveloper or Eclipse IDE. The ability to create custom job adapters is also available if for some reason you require the ability to override the default classloading strategy or need to do something specific to your needs. All this code, as I said before, can be written in a standard text editor or IDE so it can be integrated into whatever source code repository you happen to be using. This makes the deployment of, and movement of, different job versions around the Redwood environment much easier as you are dealing with versioned code.

We have implemented the custom job adapters to some degree and if anyone out there would like to discuss this I would be more then happy to chat with them about it.

To date, we have implemented two different batch type applications in two different manners. The major difference between the two is in the threading implementation approach.

One application was a report generation type process, using XSL FO and FOP, whose threading was controlled via Cronacle: 1 report request = 1 unit of work. In some cases we had upwards of 3,500 units of work. All requests would be fed into a Cronacle managed queue, on which there was a maximum concurrently running job parameter which is configurable during runtime (1 running job = 1 Cronacle controlled thread). This workload would then be consumed by any attached Cronacle Beans schedulers. A running job instance in CronacleBeans is essentially the creation and control of a thread by CronacleBeans. This would allow CronacleBeans to ensure that, whatever the max concurrent running jobs parameter was, that this number of threads would be running in your target CronacleBeans environment. As this number could be changed at runtime, you could decrease or increase this number on the fly, therefore, resources allowing, increasing or decreasing throughput. The full life cycle of these threads are maintained via CronacleBeans, so aswell as being created, they could also be sent a ‘kill’ signal if required.

The other application is an electronic enrolment type application for the insurance sector. External customers would send in enrolment files with additions, updates or terminations of existing enrolment data. The arrival of each of these files resulted in event being fired off in Cronacle. The file then started to go through a number of steps controlled via a job chain: Mercator mapping, PL/SQL jobs, Java jobs, report generation etc. The Java portion of work for this application was originally developed in a standalone, out-of-container manner, the threading of which was implemented using Doug Lea’s util.concurrent library. Using the Redwood Java API, it was quite easy to integrate this application into the CronacleBeans/OC4J environment. At the moment, Cronacle is managing the arrival of approx. 150 files a week, processing approx. 3.4 million lives and we know, based on our benchmarks, that we can push this even further.

We are currently working on some case studies to highlight our work with Redwood Cronacle and CronacleBeans. These case studies will be posted on the Decare Systems Ireland web site, but if anyone would like to contact me to discuss anything that I have mentioned here, please feel free to do so.

Please bear in mind that Redwood Cronacle and CronacleBeans are commercial products and are not freely available. We (DeCare Systems Ireland) are not software resellers, so if you require information on Redwood pricing please contact them directly.

- Jay

PS - Follow this link to see Redwood’s case study on DSI’s use of Redwood CronacleBeans.

3 Responses to “Java Scheduling with Redwood CronacleBeans”


  1. 1 Romy

    Hi,

    Firstly, i would like to thank you for this post, it’s difficult to find feedback on cronacle. Then, I’m wondering about the scope of this product (i’m a beginner in the “batch world” :)). Do you think it would be a good idea to use it with spring batch or that the 2 products have too much in common ? Does it handle moving files from one place to a ftp server for example ?

    thx !

    PS: I guess I’ll be able to get a complete answer to “what do i want to do with this tool?” in the next weeks, but a quick message would be very nice

  2. 2 Jay

    Hi Romy,

    Thanks for the post. Apologies for the late reply! I’ve been neck deep in getting a release out the door and have not had time to scratch my head never mind reply to blogs…

    Anyway, here I am now!

    Let me give you some background as to why Redwood was chosen in the first place.

    The customer that eventually purchased Redwood Cronacle and CronacleBeans are a very strong Oracle house. Not too much Java based skills in-house; that’s where we come in. They operate in the insurance sector with many files in different formats arriving over sftp on a nightly basis. These files run through a workflow: mapping, conversion, validation etc and many of these steps are executed in a Java environment.

    So the requirements were:

    1) Familiar technology (Oracle)
    2) Handle many different types of events e.g. file events, ftp etc
    3) Chain together a series of steps involving heterogenous technologies e.g. PL/SQL, Native Code, Scripting, Java etc

    One of the key requirements from a Java point of view was that we did not want to implement the rather simplistic model where each unit of work necessitated the starting of a ‘cold’ JVM. This would not give us the throughput that we were looking for.

    With CronacleBeans, we were able to start a CronacleBeans enabled container (OC4J or Tomcat in this case), or standalone if you choose, and ‘inject’ units of work into the container for action.

    Now, you need to think about the Cronacle and Cronacle Beans architecture; Queues, Schedulers and Jobs. A Scheduler is essentially a Native or Java process which can do work. A Scheduler can be attached to one or more queues. A Scheduler can process as many units of work in parallel as defined by the Job Count i.e. each Job equals a Thread.

    If you have more work to do, and you can’t squeeze anymore throughput from existing Schedulers (Cronacle Beans instances) then you can scale horizontally, or vertically if resource contention is not an issue, create a new Scheduler, attach it to the Queue and it will automatically be fed work from Cronacle.

    Using it with Spring Batch? I don’t see why not. As I said, if you need to chain together a number of steps involving events and heterogenous technologies… sure go for it. You could use Cronacle/Cronacle Beans to control when a unit of Java based work needs to be done. This could invoke a Spring based controller in your container which could in turn control multi-threading etc. Certainly worth a try. You will need to take into account Synchronous vs. Asynchronous transactions, as I imagine you would want your CronacleBeans process to wait at the Java side and have the Jobs queue on Cronacle.

    It’s complicated and would need to be thought through, but I definitely think you could make it work. In fact, one of the solutions that we have running on a CronacleBeans container, uses Cronacle to control the flow of jobs, and when a job is activated on the Java container, we use Doug Lea’s Concurrent Utils to kick-off multiple threads. We used this library because at the time we were using JDK 1.4.x.

    Good luck with what you are doing and please feel free to ping me as you go along.

    Jay

  1. 1 hotel software

Leave a Reply