2

I'm developing a very large application in JAVA / Sping MVC / Jquery over Oracle Weblogic that has a couple of screens called overviews that make multiple ajax calls to the server. All this calls should be made in parallel as they provide the summary of the different types of information to the end client. From this screens the user can then drill down to the detail of the information.

Since I have a lot of calls I'm constantly observing a behavior of the server that suggest en-queuing of the requests at the server (In the logs everything happens sequentially and when a specific type of information takes more time to process the other are only resolved when that ends).

I think I understand why this is happening, however I would like to process the requests in parallel in the server also. I'm considering two possible alternatives:

  • Change some configurations on weblogic (I don't know which one...)
  • Implement reverse ajax

I prefer the second however my server is bound to servlet 2.5 (weblogic 10.3.6) so I cannot take advantage of the new assynchronous API in servlet 3.0

I'm looking closely at atmosphere which has a very clean design IMHO. Also I'm open to other technologies suggestions. The problem is how can I do something like this in atmosphere. What I want is to shoot the requests to the server and have them processed in parallel. As soon as they are ready I want to receive the answer and close underlying connection.

How can I achieve this ?

4

1 回答 1

1

查看 DWR:http ://directwebremoting.org/dwr/index.html

这似乎是我见过的最好的 AJAX/java 解决方案。它可以以一种很好的方式对请求进行批处理,这对 AJAX 很重要。

但是,AJAX 应该默认异步处理,因此您的实现可能会发生其他事情。

也许这会有所帮助:Parallel asynchronous Ajax requests using jQuery

另外,请注意对服务器的最大并发请求数有限制:在流行的浏览器中允许多少并发 AJAX (XmlHttpRequest) 请求?

于 2012-09-25T00:23:53.250 回答