mirror of https://github.com/apache/activemq.git
Merged in revision 465987 from trunk
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.0@465990 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ef8320b2e9
commit
c0454ac325
|
@ -570,6 +570,7 @@ public class ProtocolConverter {
|
|||
} else if( message.getDataStructureType() == ActiveMQBytesMessage.DATA_STRUCTURE_TYPE ) {
|
||||
|
||||
ActiveMQBytesMessage msg = (ActiveMQBytesMessage)message.copy();
|
||||
msg.setReadOnlyBody(true);
|
||||
byte[] data = new byte[(int)msg.getBodyLength()];
|
||||
msg.readBytes(data);
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ package org.apache.activemq.transport.stomp;
|
|||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
|
||||
|
@ -91,18 +93,23 @@ public class StompSubscription {
|
|||
ack.setConsumerId(consumerInfo.getConsumerId());
|
||||
|
||||
int count=0;
|
||||
for (Iterator iter = dispatchedMessage.keySet().iterator(); iter.hasNext();) {
|
||||
for (Iterator iter = dispatchedMessage.entrySet().iterator(); iter.hasNext();) {
|
||||
|
||||
Map.Entry entry = (Entry) iter.next();
|
||||
String id = (String) entry.getKey();
|
||||
MessageId msgid = (MessageId) entry.getValue();
|
||||
|
||||
String id = (String) iter.next();
|
||||
if( ack.getFirstMessageId()==null )
|
||||
ack.setFirstMessageId((MessageId) dispatchedMessage.get(id));
|
||||
ack.setFirstMessageId(msgid);
|
||||
|
||||
iter.remove();
|
||||
count++;
|
||||
|
||||
if( id.equals(messageId) ) {
|
||||
ack.setLastMessageId((MessageId) dispatchedMessage.get(id));
|
||||
ack.setLastMessageId(msgid);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ack.setMessageCount(count);
|
||||
|
|
Loading…
Reference in New Issue