aspose file tools*
The moose likes Web Services and the fly likes Web service orchestrating and multithreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web service orchestrating and multithreading" Watch "Web service orchestrating and multithreading" New topic
Author

Web service orchestrating and multithreading

Patrick Davenport
Greenhorn

Joined: May 12, 2009
Posts: 10
Hello,
I'm currently working on a large web service implementation. We are orchestrating services where a parent web service needs to call multiple children services in order to satisfy its request. All of this is living happily in websphere 6.1. Currently we are doing this in series: child a, child b, etc. However, there is no reason that they need to execute in this order: b, a, c would work just as well. I would prefer to wrap each call in a thread, kick them off and wait on them until they finish.

I've tried to create new threads and run them. Unfortunately some of the legacy code uses jndi lookups and these go bad due to the fact that the threads are rogues in the container. Is there any way to get threads like I need? Heck, I'd even think about EJBs if I could run them in parallel.

Thanks for your time,
JPD
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Well, EJBs are guaranteed to be invoked by one single thread at a time. Stateless session beans can exist in multiple instances that are not associated to a specific client and that are pooled. The problem is that, prior to EJB 3.1, invocation of stateless session beans can only be synchronous. I am also not sure that stateless session EJBs will solve the problem with your legacy code.
A suggestion regarding the JNDI lookups is to, if possible, resolve them prior to running each job - then you would be free to use ordinary threading.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web service orchestrating and multithreading