qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r580922 - /incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
Date Mon, 01 Oct 2007 11:09:47 GMT
Author: arnaudsimon
Date: Mon Oct  1 04:09:32 2007
New Revision: 580922

URL: http://svn.apache.org/viewvc?rev=580922&view=rev
Log:
Changed onMessage to copy the incoming byteBuffer

Modified:
    incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java?rev=580922&r1=580921&r2=580922&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
Mon Oct  1 04:09:32 2007
@@ -29,10 +29,7 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.protocol.AMQConstant;
 import org.apache.qpidity.api.Message;
-import org.apache.qpidity.transport.Struct;
-import org.apache.qpidity.transport.ExchangeQueryResult;
-import org.apache.qpidity.transport.Future;
-import org.apache.qpidity.transport.RangeSet;
+import org.apache.qpidity.transport.*;
 import org.apache.qpidity.QpidException;
 import org.apache.qpidity.filter.MessageFilter;
 import org.apache.qpidity.filter.JMSSelectorFilter;
@@ -141,7 +138,10 @@
                 new UnprocessedMessage_0_10(channelId, deliveryId, consumerTag, exchange,
routingKey, redelivered);
         try
         {
-            newMessage.receiveBody(message.readData());
+            ByteBuffer buff = message.readData();
+            ByteBuffer newBuf = ByteBuffer.allocate(buff.remaining()) ;
+            newBuf.put(buff);
+            newMessage.receiveBody(newBuf);
         }
         catch (IOException e)
         {



Mime
View raw message