Author: sebb
Date: Sat Jun 16 12:58:26 2012
New Revision: 1350918
URL: http://svn.apache.org/viewvc?rev=1350918&view=rev
Log:
JMS Point to Point reports too high response times in Request Response Mode
- ensure the timeout is actually used
Bugzilla Id: 53357
Modified:
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
Modified:
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java?rev=1350918&r1=1350917&r2=1350918&view=diff
==============================================================================
---
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
(original)
+++
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
Sat Jun 16 12:58:26 2012
@@ -19,6 +19,7 @@
package org.apache.jmeter.protocol.jms.sampler;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -89,7 +90,13 @@ public class FixedQueueExecutor implemen
if (log.isDebugEnabled()) {
log.debug(Thread.currentThread().getName()+" will wait for
reply " + id + " started on " + System.currentTimeMillis());
}
- countDownLatch.await();
+ // This used to be request.wait(timeout_ms), where 0 means forever
+ // However 0 means return immediately for the latch
+ if (timeout == 0){
+ countDownLatch.await(); //
+ } else {
+ countDownLatch.await(timeout, TimeUnit.MILLISECONDS);
+ }
if (log.isDebugEnabled()) {
log.debug(Thread.currentThread().getName()+" done waiting for
" + id + " on "+request+" ended on " + System.currentTimeMillis());
}