3

I'm using Quartz to regularly create a bunch of jobs that I sent to a queue (RabbitMQ) where they are picked up and executed by Akka actors. One piece that is missing is job monitoring. If one job fails, I don't even notice.

The jobs are fairly simple: they only have 1-2 parameters and there are no dependencies.

Is there anything (library, best practice etc.) I can leverage for this (even a SQL schema would be a good start)?

PS: I already considered Spring-Batch and it seems to be too much overhead.

stephanos
  • 3,319
  • 7
  • 33
  • 47
  • Use !!! to send the job to the worker and then register an onComplete-callback to the future to handle any failure. Or Supervise your worker and have the preRestart callback reply with the error? – Viktor Klang May 15 '11 at 16:41
  • Thanks for your comment! The thing is that some of the jobs interact with an API - by putting them into the database I can track what happens with them, retry them after a specific time and abort if they fail like 5 times in a row. Plus, I can do some basic statistics about failure rate and speed of the jobs. – stephanos Jun 15 '11 at 07:23

1 Answers1

1

I think that you'll find tools to monitor JMS. Typical one is bundle with the JMS vendor. An interresting feature of JMS would be that it can detect message processing failure send the message to another consummer.

Assuming you go the JMS monitoring route you'll require to: - make your Akka actor synchronous so the JMS message will wait for it to respond before proceding to failure or success. - log failures for Quartz job that weren't able to send JMS message.

Another solution would be to be fully synchronous and let the Quartz message manage the loging (possibly in a base class or a proxy) so all you have to do for monitoring is reading the log file.

From my understanding Akka Actor monitoring is not here yet, but it is on the plans. In the meantime, you can have a start here: http://groups.google.com/group/akka-user/browse_thread/thread/3818fb17bef95869

Nicolas Bousquet
  • 3,990
  • 1
  • 16
  • 18