对于给定的会话,有什么方法可以找到以前的 HttpRequest 吗?
Web 客户端向长期运行的 Web 服务发送请求。当此服务运行时,客户端发送另一个请求。我想找到第一个请求并向其发送停止信号。
背景:我有一个需要 2-4 秒来处理的 Web 服务。servlet 托管在 Tomcat 容器中,并使用 OSGi 访问另一个插件中的主处理器。
The requests come from another web site that allows users to make 10 or so requests at a time. While the user is waiting they may make another page change that will start another 10 web requests. I need a way to locate the previous requests. Then I'll find a way to send a stop signal to the long running process which will allow the original HttpRequest to finish with some suitable error code.
Perhaps another way to look at this problem is to say: if a client makes a series of requests that overlap then we only want to service the last request and cancel the previous requests as soon as possible.