Batch Job Improvements

Initial Thoughts

Mifos currently uses its own implementation of batch job functionality. Leveraging existing libraries that provide the current functionality (and more) would be a good option since it will allow us to eliminate code from Mifos (less to maintain, debug) and use more standard, well documented and full featured alternatives. The Quartz library would be a good candidate and it has nice integration with the Spring framework.

Using a standard library like Quartz with Spring would also allow us to do some convenient JMX instrumentation which in conjunction with a JMX console (such as mc4j) would allow a Mifos administrator to monitor Mifos batch jobs and even manually kick them off when necessary.

Also, using Spring will make adding a feature to permit running jobs in parallel easier to implement.


Lessons learned from issue 2098...

  • Modify the batch job so that if it has issues handling a particular record, it handles this more gracefully (skips the record, provides an error in the log file, and moves on to the next record)
  • Alway note any records (account ids) that could not be handled successfully in the scheduled_tasks table
  • Provide information in the log files to track progress of the task as it works, so that if there are issues in the future, we can determine if the batch job is working or not rather than waiting several hours until it fails.

See also: Batch Job Best Practices