permaculture playing cards
The moose likes JBoss/WildFly and the fly likes Running java-threads in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Running java-threads in JBoss" Watch "Running java-threads in JBoss" New topic

Running java-threads in JBoss

R Bieringa

Joined: Nov 04, 2009
Posts: 25

I'm working on an application that requires users starting batchlike-processes. The processes can taken up to hours to complete. Now this is implemented by classes, extending the thread-class.
The application is not in production, but will have to be within the near future. My question now is this: is this approach (running "standard" threads) a healthy one ? In the past, this wasn't even allowed on most application-servers.
If not, I know about one other solution: using JMS, which also makes running "asynchronous". But is there maybe an alternative, as messaging seems a bit of a "heavy" solution for this (like shooting a mosquito using a 120mm canon). But maybe I'm exaggerating.

I'm using JBoss 5.1.0 EAP and Java 6.

I would appreciate your input.

Peter Johnson

Joined: May 14, 2008
Posts: 5852

Starting a separate thread within a Java EE app is a bad idea, it can lead to all kinds of problems. The JMS mechanism is really the way to go.

JBoss In Action
Dimitrios Bouras

Joined: Oct 17, 2011
Posts: 1
Can you givee an example of how to implement this using JMS
I agree. Here's the link:
subject: Running java-threads in JBoss
It's not a secret anymore!