Whether you need the "cache stuff" depends on whether your 1) servlet application maintains session state between requests and 2) you care about failover, i.e. is it important that the session state be there if the client fails over.
Re: UrlConnection.connect, if you cluster the servlet app, you need some kind of load balancer in front of it to distribute the requests. The URL the applications point to is the load balancer. UrlConnection.connect is fine; the issue is having the correct URL.
Thank you very mcuh for your replying.
I think I don't need to maintain the seesion state. the client send a request to report servlet, the servet will generate a sessionID being save in a hastable, and send ID back to the client. then Every 15 seconds, the client will send a request with this ID to query the status of report (like how many the percentage is done).
Could you tell me I need to care about fails over for this case?
If there are 2 nodes, How to set up my every 15 seconds request will stick on the the first request node?
Thank you again,
Lets say the client sends the request and starts polling every 15 seconds. Then the server producing the report dies. What do you want to happen? Client connects to another server *which picks up the report creation where the first one left off*? Probably not possible, but if it is and you want it, then you need failover. I suspect that's not what you want/need.
How to set up sticky sessions depends on what load balancer you use. Here is a wiki page with more on using Apache mod_jk as the load balancer:
I see, Thank you very much.