activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r804192 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/transport/stomp/StompConnection.java test/java/org/apache/activemq/transport/stomp/StompTest.java
Date Fri, 14 Aug 2009 12:29:59 GMT
Author: dejanb
Date: Fri Aug 14 12:29:58 2009
New Revision: 804192

URL: http://svn.apache.org/viewvc?rev=804192&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-1807 - aborting transaction test revisited +
solution

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java?rev=804192&r1=804191&r2=804192&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java
Fri Aug 14 12:29:58 2009
@@ -188,6 +188,15 @@
     }
     
     public void abort(String transaction) throws Exception {
+    	// discard all content on the wire before
+    	// aborting the transaction
+    	try {
+    		StompFrame discarded = this.receive(100);
+    		while (discarded != null) {
+    			discarded = this.receive(100);
+    		}
+    	} catch (Exception e) {    		
+    	}
     	HashMap<String, String> headers = new HashMap<String, String>();
     	headers.put("transaction", transaction);
     	StompFrame frame = new StompFrame("ABORT", headers);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?rev=804192&r1=804191&r2=804192&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
Fri Aug 14 12:29:58 2009
@@ -972,6 +972,7 @@
         } catch (SocketTimeoutException soe) {}
         
         stompConnection.ack(frame1, "tx1");
+        Thread.sleep(1000);
         stompConnection.abort("tx1");
         
         stompConnection.begin("tx2");



Mime
View raw message