mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4297 -resolve intermittent hang/fail of stomp tests
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1442688 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4650f998db
commit
37ad85e3bd
|
@ -107,7 +107,9 @@ public class StompSubscription {
|
||||||
unconsumedMessage.clear();
|
unconsumedMessage.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized void onStompCommit(TransactionId transactionId) {
|
void onStompCommit(TransactionId transactionId) {
|
||||||
|
MessageAck ack = null;
|
||||||
|
synchronized (this) {
|
||||||
for (Iterator<?> iter = dispatchedMessage.entrySet().iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = dispatchedMessage.entrySet().iterator(); iter.hasNext();) {
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
Map.Entry entry = (Entry)iter.next();
|
Map.Entry entry = (Entry)iter.next();
|
||||||
|
@ -118,11 +120,15 @@ public class StompSubscription {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!unconsumedMessage.isEmpty()) {
|
if (!unconsumedMessage.isEmpty()) {
|
||||||
MessageAck ack = new MessageAck(unconsumedMessage.getLast(), MessageAck.STANDARD_ACK_TYPE, unconsumedMessage.size());
|
ack = new MessageAck(unconsumedMessage.getLast(), MessageAck.STANDARD_ACK_TYPE, unconsumedMessage.size());
|
||||||
protocolConverter.getStompTransport().sendToActiveMQ(ack);
|
|
||||||
unconsumedMessage.clear();
|
unconsumedMessage.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// avoid contention with onMessageDispatch
|
||||||
|
if (ack != null) {
|
||||||
|
protocolConverter.getStompTransport().sendToActiveMQ(ack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
synchronized MessageAck onStompMessageAck(String messageId, TransactionId transactionId) {
|
synchronized MessageAck onStompMessageAck(String messageId, TransactionId transactionId) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue