Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…hang/fail of stomp tests

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1442688 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
gtully committed Feb 5, 2013
1 parent 4650f99 commit 37ad85e
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,26 @@ synchronized void onStompAbort(TransactionId transactionId) {
unconsumedMessage.clear();
}

synchronized void onStompCommit(TransactionId transactionId) {
for (Iterator<?> iter = dispatchedMessage.entrySet().iterator(); iter.hasNext();) {
@SuppressWarnings("rawtypes")
Map.Entry entry = (Entry)iter.next();
MessageDispatch msg = (MessageDispatch)entry.getValue();
if (unconsumedMessage.contains(msg)) {
iter.remove();
void onStompCommit(TransactionId transactionId) {
MessageAck ack = null;
synchronized (this) {
for (Iterator<?> iter = dispatchedMessage.entrySet().iterator(); iter.hasNext();) {
@SuppressWarnings("rawtypes")
Map.Entry entry = (Entry)iter.next();
MessageDispatch msg = (MessageDispatch)entry.getValue();
if (unconsumedMessage.contains(msg)) {
iter.remove();
}
}
}

if (!unconsumedMessage.isEmpty()) {
MessageAck ack = new MessageAck(unconsumedMessage.getLast(), MessageAck.STANDARD_ACK_TYPE, unconsumedMessage.size());
if (!unconsumedMessage.isEmpty()) {
ack = new MessageAck(unconsumedMessage.getLast(), MessageAck.STANDARD_ACK_TYPE, unconsumedMessage.size());
unconsumedMessage.clear();
}
}
// avoid contention with onMessageDispatch
if (ack != null) {
protocolConverter.getStompTransport().sendToActiveMQ(ack);
unconsumedMessage.clear();
}
}

Expand Down

0 comments on commit 37ad85e

Please sign in to comment.