ActiveMQ C++ Client
  1. ActiveMQ C++ Client
  2. AMQCPP-371

bytesmessages's size doubled If Message body compression enabled

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0, 3.3.0
    • Fix Version/s: 3.4.1, 3.5.0
    • Component/s: CMS Impl
    • Labels:
      None
    • Environment:

      windows 3.4.0

      Description

      If the URI option connection.useCompression=true, an ActiveMQBytesMessage's size will always become doubled. I changed the ActiveMQByteMessage.cpp as follow, the problem seems been solved.

      
      class ByteCounterOutputStream : public FilterOutputStream {
      private:
      
      int* length;
      
      private:
      
      ByteCounterOutputStream( const ByteCounterOutputStream& );
      ByteCounterOutputStream operator= ( const ByteCounterOutputStream& );
      
      public:
      
      ByteCounterOutputStream( int* length, OutputStream* stream, bool own = false )
      : FilterOutputStream( stream, own ), length( length ) {
      }
      
      virtual ~ByteCounterOutputStream() {}
      
      protected:
      
      virtual void doWriteByte( unsigned char value ) {
      (*length)++;
      FilterOutputStream::doWriteByte( value );
      }
      
      virtual void doWriteArray( const unsigned char* buffer, int size ) {
      
      //(*length) += size; removed because of length has been double sized
      FilterOutputStream::doWriteArray( buffer, size );
      }
      
      virtual void doWriteArrayBounded( const unsigned char* buffer, int size, int offset, int length ) {
      
      //(*this->length) += length; removed because of length has been double sized
      FilterOutputStream::doWriteArrayBounded( buffer, size, offset, length );
      }
      
      };
      
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Timothy Bish
            Reporter:
            邱承
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development