views:

36

answers:

1

I have a few different apps which need robust database-backed job/task queues, and so far I've had trouble identifying any promising candidates. I'd love some suggestions!

BTW, by database-backed I intend something which persists job data and status to a JDBC DB for reliability purposes.

Oh, I'm specifically looking for a library. I'm aware of systems such as ActiveMQ and JMS-based systems. But I need my apps to remain self-contained and not turn into entire platforms. (I've also always had some trouble making the conceptual leap to modeling jobs/tasks as messages.)

Thanks, Avi

+2  A: 

I recommend you take another look at ActiveMQ. While it is by default a standalone application, you can also embed it in your application, making it "self-contained". I've done this using ActiveMQ's Spring support but you can also do it programmatically by simply instantiating the correct classes in your app. ActiveMQ is lightweight and offers several persistence mechanisms.

Regarding whether there is a dissonance with thinking of "messages" as "jobs", I guess it depends on what you mean by "job". If I hand you a piece of paper that says "mow the lawn" and you think of that as a job, then messages can be jobs. If instead you don't have a job until you actually start mowing the lawn, then they are not.

Perhaps you may want to look at Spring Batch, which uses a job-based domain model. It too is embeddable and has persistence, retry, etc. built in.

SingleShot
Thanks!Do you have any thoughts on what I perceive of the dissonance involved in thinking of jobs as "messages"? Am I just being too rigid/literal?
Avi Flax
@Avi: I've added two paragraphs to my answer.
SingleShot
Awesome, thanks!
Avi Flax