qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1618871 - in /qpid/trunk/qpid/java: broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
Date Tue, 19 Aug 2014 14:22:20 GMT
Author: rgodfrey
Date: Tue Aug 19 14:22:20 2014
New Revision: 1618871

URL: http://svn.apache.org/r1618871
Log:
QPID-6000 : [Java] Address review comments from Alex

Modified:
    qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java?rev=1618871&r1=1618870&r2=1618871&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
Tue Aug 19 14:22:20 2014
@@ -285,6 +285,7 @@ public class ConsumerTarget_0_10 extends
         else if(!msgCompressed
                 && compressionSupported
                 && (messageProps == null || messageProps.getContentEncoding()==null)
+                && body != null
                 && body.remaining() > _session.getConnection().getMessageCompressionThreshold())
         {
             byte[] compressed = GZIPUtils.compressBufferToArray(body);

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java?rev=1618871&r1=1618870&r2=1618871&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
(original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
Tue Aug 19 14:22:20 2014
@@ -20,14 +20,12 @@
  */
 package org.apache.qpid.client.message;
 
-import java.io.ByteArrayOutputStream;
 import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
 import java.util.Iterator;
 import java.util.List;
-import java.util.zip.GZIPInputStream;
 
 import javax.jms.JMSException;
 
@@ -164,30 +162,6 @@ public abstract class AbstractJMSMessage
         return message;
     }
 
-    private ByteBuffer uncompressBody(final InputStream bodyInputStream) throws AMQException
-    {
-        final ByteBuffer data;
-        try(GZIPInputStream gzipInputStream = new GZIPInputStream(bodyInputStream))
-        {
-            ByteArrayOutputStream uncompressedBuffer = new ByteArrayOutputStream();
-            int read;
-            byte[] buf = new byte[4096];
-            while((read = gzipInputStream.read(buf))!=-1)
-            {
-                uncompressedBuffer.write(buf,0,read);
-            }
-            byte[] uncompressedBytes = uncompressedBuffer.toByteArray();
-            data = ByteBuffer.wrap(uncompressedBytes);
-        }
-        catch (IOException e)
-        {
-            // TODO - shouldn't happen
-            throw new AMQException("Error uncompressing gzipped message data", e);
-        }
-        return data;
-    }
-
-
     public AbstractJMSMessage createMessage(long messageNbr, boolean redelivered, ContentHeaderBody
contentHeader,
                                             AMQShortString exchange, AMQShortString routingKey,
List bodies,
                                                          AMQSession_0_8.DestinationCache<AMQQueue>
queueDestinationCache,



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message