activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r465987 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp: LegacyFrameTranslator.java StompSubscription.java
Date Fri, 20 Oct 2006 04:45:14 GMT
Author: chirino
Date: Thu Oct 19 21:45:12 2006
New Revision: 465987

URL: http://svn.apache.org/viewvc?view=rev&rev=465987
Log:
Found some issues with the client ack handling for stomp and bytes message conversion while
looking into:
https://issues.apache.org/activemq/browse/AMQ-978


Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java?view=diff&rev=465987&r1=465986&r2=465987
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
Thu Oct 19 21:45:12 2006
@@ -54,6 +54,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/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java?view=diff&rev=465987&r1=465986&r2=465987
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
Thu Oct 19 21:45:12 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