mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-1807 - aborting transaction test revisited + solution
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@804192 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c2205356ff
commit
a15e6efabd
|
@ -188,6 +188,15 @@ public class StompConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void abort(String transaction) throws Exception {
|
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>();
|
HashMap<String, String> headers = new HashMap<String, String>();
|
||||||
headers.put("transaction", transaction);
|
headers.put("transaction", transaction);
|
||||||
StompFrame frame = new StompFrame("ABORT", headers);
|
StompFrame frame = new StompFrame("ABORT", headers);
|
||||||
|
|
|
@ -972,6 +972,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
} catch (SocketTimeoutException soe) {}
|
} catch (SocketTimeoutException soe) {}
|
||||||
|
|
||||||
stompConnection.ack(frame1, "tx1");
|
stompConnection.ack(frame1, "tx1");
|
||||||
|
Thread.sleep(1000);
|
||||||
stompConnection.abort("tx1");
|
stompConnection.abort("tx1");
|
||||||
|
|
||||||
stompConnection.begin("tx2");
|
stompConnection.begin("tx2");
|
||||||
|
|
Loading…
Reference in New Issue