File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Asynchronous processing in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Asynchronous processing in servlets" Watch "Asynchronous processing in servlets" New topic
Author

Asynchronous processing in servlets

Siva Krishnamurthy
Greenhorn

Joined: Mar 24, 2004
Posts: 6
We are having a problem where in we need to do some processing asynchrnously in a servlet as it takes time to do that part.
Is it a good practice to spawn a thread inside a serrvlet?? Or can JMS be used? I'm new to the messaging technology..
Please help...
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I think either one of them will be a good approach. There are a few concerns. For instance, if you're running this in a pure web container like Tomcat, you may not have a built in JMS service available, so you'd have to run one separately. In JBoss, I think it's taken care of, but that's different software.
But I don't see any reason why either approach wouldn't be okay. Using a separate thread seems a lot more simple and to the point. JMS would be more extensible in the future, but maybe you don't really need all that to do what you want. Options, options, options.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
See this month's Javaranch Journal, where I write an article on EXACTLY THIS!
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Siva Krishnamurthy
Greenhorn

Joined: Mar 24, 2004
Posts: 6
Thanks for the info
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Asynchronous processing in servlets