activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r465990 - in /incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp: ProtocolConverter.java StompSubscription.java
Date Fri, 20 Oct 2006 04:47:49 GMT
Author: chirino
Date: Thu Oct 19 21:47:48 2006
New Revision: 465990

URL: http://svn.apache.org/viewvc?view=rev&rev=465990
Log:
Merged in revision 465987 from trunk

Modified:
    incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
    incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java

Modified: incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java?view=diff&rev=465990&r1=465989&r2=465990
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
Thu Oct 19 21:47:48 2006
@@ -570,6 +570,7 @@
         } 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);
 

Modified: incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java?view=diff&rev=465990&r1=465989&r2=465990
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
Thu Oct 19 21:47:48 2006
@@ -20,6 +20,8 @@
 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 @@
         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);



Mime
View raw message