users@glassfish.java.net

Java EE and batch processing

From: Laird Nelson <ljnelson_at_gmail.com>
Date: Sat, 4 Feb 2012 10:25:49 -0500

I know that there is a batch processing JSR in the works.

In the meantime, what are some of the patterns people have used for batch
processing in a Java EE 6 system?

We're looking uneasily at doing something that would involve kicking off a
bunch (hundreds) of asynchronous EJB calls (returning Futures) and then
somehow coordinating the Futures with the equivalent of a CountdownLatch
(so that when all several hundred tasks are complete we can take a summary
action).

(We might be able to use an *actual* CountdownLatch if we can guarantee
that all the beans we're coordinating are @Local (so that they could call
methods on a locally-passed CountdownLatch). This still smells pretty
awful to me, however.)

Another alternative involves building a complicated pinball machine out of
message-driven beans that somehow notify a
stateful-for-the-life-of-the-coordination bean when all of the several
hundred asynchronous tasks are completed. This smells even worse to me.

I have no interest in pulling in Spring batch, just for the record.

Please feel free to email me directly with any approaches you've seen in
the wild that have worked, or feel free to post them to the forums.

Best,
Laird

-- 
http://about.me/lairdnelson