Oddjob

from rgordon.co.uk

FAQ

General

What's a business orientated approach?

A business orientated approach is - automatic failover to a retry schedule when your job fails. The ability to schedule for a certain number of retries before sending an alert. Scheduling with time-zones. Scheduling around holidays. Easy manual intervention when things go wrong.

How technical do you need to be to use Oddjob?

Oddjob is designed for three levels of user:

  • The non technical but computer literate user can monitor jobs and manually intervene when necessary.
  • The technical user, can easily create and deploy scheduling configurations.
  • The programmer can extend Oddjob by writing their own jobs or use Oddjob jobs in their own code.

Oddjob isn't just a scheduler is it?

No it's not. Calling oddjob a scheduler is just an easy way to introduce people to Oddjob. Oddjob is a a way of grouping tasks or jobs and creating dependencies between them. Something will trigger these jobs and mostly this will be time driven.

There are loads of schedulers out there - is there room for another one?

Oddjob is more than a scheduler and infact it isn't even a scheduler because it uses Quartz internally to do it's scheduling. Oddjob brings a level of monitoring and control to distributed scheduling that no other 'free for commercial use' scheduler does.

When will Oddjob be stable?

It's very close but it's not quite there yet. As a part time project it's about six months away.

Oddjob

How do I set up a job to run only if another job succeeds?

  • sequential
    • Job 1
    • Job 2

Job 2 will only run if Job 1 succeeds.

Alternativley you can also use a trigger schedule instead.

How do I have two things happen at once and then a third thing happen when the first two have finished?

  • sequential
    • parrallel
      • Thing 1
      • Thing 2
    • Dependent thing.

Again, you can also use a trigger schedule.

How do I change what oddjob runs when I double click run-oddjob.jar?

Oddjob processes the contents of the file oddjob.xml found in the same directory as the jar file. This can be changed with Oddjob Designer just like any other Oddjob file.

Why COMPLETE and NOT COMPLETE not SUCCESS and FAILURE?

Oddjob doesn't fail! - it merley deferres success. Oddjob is all about retrying and NOT COMPLETE was intended to reflect this.

Why can you only configure a nested Oddjob?

It might seem slightly irritating that you can't specifiy a classpath or name attrribute at the top level oddjob element but there are two problems with this. Firstly Oddjob is already running when it process the file so it would have to reconfigure itself mid flow. Secondly which configuration should Oddjob use? That applied on the nested Oddjob, or that in the top level element? To keep things simple only extenal configuration of Oddjob is supported. This does however mean that we sometimes need two Oddjob files to get something done.

Development

Oddjob is heavily based on Ant - why not just use Ant?

Ant is a fantastic build tool, Ant was never designed for the business event model Oddjob is aimed at, the fact it comes so close is a great credit to it's design. But Ant has a few drawbacks for this purpose.

Ant has only two completion states. Complete or BuildException. For the business type flow of events I'm conviced there has to be three completion states which is why Oddjob has Complete, Not Complete and Exception.

Ant is designed to run from start to finish, not continuously. The way Ant uses dependencies works becuase the tasks run once. It would be difficult to configure an Ant target who's completion depended on successfully sending reports daily to a few dozen clients for the next ten years.

With version 0.11 you can now use most Ant tasks within Oddjob and that's the bit of Ant that bussiness intergration really needs. ftp, mail etc.

Is Oddjob an application framework?

It wasn't intended to be but if you wished to write a business component that is automatically configured, can log events, can be managed remotely, and can be triggered from within a container then Oddjob is a good choice. So yes, Oddjob is an application framework.

Why not use an existng application framework such as Spring?

Early Oddjob was based on Avalon but I didn't like the dependancy of a Job on a paticular framework. I looked at Spring as being the best POJO style application framework but the XML configuration files are ugly and there is no support for binding properties at runtime, so I took the Ant code base merged in BeanUtils and created Arooa (A rip off of Ant) which I'm pretty happy with.

Why not use rules based XML configuration?

A rules based configuration such as Digester was a possibility but I felt it was better suited to the situation where there weren't going to be many components to configure. When righting lots of jobs I believe it's quicker to program to a particular style which is what Ant and Oddjob do.

Why Log4j not commons-logging?

Log4j allow a thread local context to be used which Oddjob will use to capture log message from Loggers in classes which a job uses when executing. There is no equivalent in commons-logging as far a I am aware.