hi, can you please explain some details of your context and components?
I have a webapp that consumes a lot of webservices(something like 10 today).
I need to consume all those webservices and display the result to my end user.
Making it sequentially results in a delay of (more or less) 10/13 minutes to display the result.
Making it concurrently results in 1,5 minute. What is very acceptable in this context.
I tried common multithread in JEE environment(bad idea) just to get the results. Worked but I lost the session context that is necessary to parse the results from webservices.
I tried also a JMS approach, but I lost the Seam contexts this way, what makes impossible the parse of my response.
Know I don't know what to do :(
Make stateless session bean, which has access to jboss cache, place in to jboss cache a object that represents data that you will show as result.
start every x times a jms action to consume services and inject about abve described ejb session bean result to the jboss cache...
you can consume in seam the jboss cache an show result...
do this way help you?
It's a good idea, but it does not apply to my scenario.
I need to consume the webservice with very specific parameters, informed by the user, so I need to consume it when my user inputs some parameter, the idea of cache the results from WS is not an option here.
I think that I will try to pass as parameter anything that I need from Seam than make the multithread in the standard(but not recommended) way.
This away, passing all I need as parameter, I do not need to access seam contexts to get this variables.
I'm not very happy with this solution, so I would like to hear more opinions.
If you cannot cache, 3 points..
1) I would work on
how produce the reportto optmize the response
2) I would start to think to profile jboss
3) I would loadbalance with apache
my 2 cent
First of all, thanks for your reply.
I will tell the real scenario to make thing more clear.
I'm creating an air-tickets reservation system that integrates a couple of differentes air lines services(actually 10, but we will expand to more).
The time to create the object to be sent is minimal, my problem is making sequential calls to these webservices, some of them take more than 45 seconds to respond.
The problem is not making the request, neither parse the response, but the time to the webservice(external, not under my control) to respond.
For this reason I choose to use multithread.
maybe you can use seam remote and fire all methods asynchronous at the firing moment you can register the event in a data structure like hash in java script and check if all request are ready... if all requests are ready go on...
not dice... i think this way is not thread save...