Java 使用org.eclipse.jetty.continuation.continuation控制单个HTTP保持活动请求上每秒事务数的计数

Java 使用org.eclipse.jetty.continuation.continuation控制单个HTTP保持活动请求上每秒事务数的计数,java,eclipse,jetty,apache-camel,jetty-9,Java,Eclipse,Jetty,Apache Camel,Jetty 9,如何使用org.eclipse.jetty.continuation.continuation类处理单个HTTP保持活动请求的每秒事务计数 我扩展了org.apache.camel.component.http.CamelServlet并重写了它的服务方法,在HTTPConsumer的帮助下,我获得了camel Exchange 我无法弄清楚如何获取这个HttpRequest对象中发生的事务数 代码如下:- protected void service(HttpServletRequest re

如何使用org.eclipse.jetty.continuation.continuation类处理单个HTTP保持活动请求的每秒事务计数

我扩展了org.apache.camel.component.http.CamelServlet并重写了它的服务方法,在HTTPConsumer的帮助下,我获得了camel Exchange

我无法弄清楚如何获取这个HttpRequest对象中发生的事务数

代码如下:-

protected void service(HttpServletRequest request, HttpServletResponse response) 
{
   HttpConsumer consumer = resolve(request);
if (consumer == null)
{
response.sendError(404);
return;
}
if ((consumer.getEndpoint().getHttpMethodRestrict() != null) && (!consumer.getEndpoint().getHttpMethodRestrict().equals(request.getMethod())))
{
response.sendError(405);
return;
}
if (("TRACE".equals(request.getMethod())) && (!consumer.isTraceEnabled()))
{
response.sendError(405);
return;
}
Exchange result = (Exchange)request.getAttribute("CamelExchange");
if (result == null)
{
final Continuation continuation = ContinuationSupport.getContinuation(request);
//After getting continuation,
//How to get the count for Number of Transaction Happen Inside this Single HTTPRequest (in this case request object)  

到目前为止你做了什么?有代码吗?@Peter我已经添加了代码,并添加了注释,建议需要做些什么来获得这个HTTP请求对象上发生的事务数。[考虑HTTP请求带有Keep-Alive参数]。因此,在这种情况下,这个请求会发生任意数量的事务。@Peter,你能更新一下吗,我正在等待你的答复?代码是纯格式化的,我缺少所有事务的驼峰路由,如DB访问等。@Peter我不是说基于DB的事务,我知道jetty使用Continuation类支持Http Keepalive。如何获取此单个HTTPRequest的测试程序集数