项目中web前端使用activemq来做request/response请求,但是实际使用中发现,经常发出一个请求后,结果要几十秒才返回。
原因是activemq用的版本比较高,它在activemq-web中有个判断continuation是否过期的判断是只针对servlet3.0的,但是tomcat 6的servlet是2.5版本,所以要将这个判断改成适用2.5版本的。
修改org.apache.activemq.web.AjaxListener源码,
将
if ((!this.continuation.isResumed()) && (!this.continuation.isInitial())) 改成if ((!this.continuation.isResumed()) && (!this.continuation.isExpired()))