-
1. Re: Parallel processing in a JBoss app?
ohako Jan 17, 2008 1:34 PM (in response to ohako)not sure if this is allowed here...bump!
I'm still interested to know if there's an answer, you see. -
2. Re: Parallel processing in a JBoss app?
mjhammel Jan 17, 2008 3:20 PM (in response to ohako)I won't call myself experienced, just entagled. However, you don't want to use a separate thread here. Instead, have the incoming request/action posted to a db table and then use a Schedulable class that checks once a minute (or whatever time period you like) to see what emails need to be sent, to whom and with what content in response to the request/action. Since the email doesn't have to go out immediately, this mechanism is better suited to your needs than threads.
I just implemented my first Schedulable and it was rather simple (though I'm using EJB3.0 I haven't got injection working so I have to get my EntityManager and it's ilk manually). Once you have the schedulable querying the db, you can probably use JMS or Java Mail to send the mail messages.
Using a schedulable removes the need for threading in your app and leaves threading issues to the application server.
See http://labs.jboss.com/file-access/default/members/jbossas/freezone/docs/Server_Configuration_Guide/beta422/html/Additional_Services-Scheduling_Tasks.html for more information on scheduling tasks in JBOSS.