tag:blogger.com,1999:blog-1000597103989045457.post6338778602485575329..comments2022-04-01T00:45:06.103-07:00Comments on Thoughts of Tim Bish: ActiveMQ-CPP now supports Message body compressionTimhttp://www.blogger.com/profile/03370927021680126470noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-1000597103989045457.post-8043407676140660512011-05-04T20:36:45.410-07:002011-05-04T20:36:45.410-07:00No problem.
https://issues.apache.org/jira/browse/...No problem.<br />https://issues.apache.org/jira/browse/AMQCPP-371markqiuhttps://www.blogger.com/profile/06434471488299650538noreply@blogger.comtag:blogger.com,1999:blog-1000597103989045457.post-31813371547899906002011-05-04T19:21:30.173-07:002011-05-04T19:21:30.173-07:00It'd be great if you could create a new Jira i...It'd be great if you could create a new Jira issue for this problem and attach your fixes as a patch, granting license to apache of course. <br /><br />https://issues.apache.org/jira/browse/AMQCPP<br /><br />I can get the fix into the next release then.Timhttps://www.blogger.com/profile/03370927021680126470noreply@blogger.comtag:blogger.com,1999:blog-1000597103989045457.post-71576562971573471982011-05-04T18:55:46.220-07:002011-05-04T18:55:46.220-07:00Hi, Tim.
It seems I catched the bug.
If the URI op...Hi, Tim.<br />It seems I catched the bug.<br />If the URI option connection.useCompression=true, an ActiveMQBytesMessage will always become double sized. I changed the ActiveMQByteMessage.cpp as follow, the problem seems solved. Please help me!<br /><br /> class ByteCounterOutputStream : public FilterOutputStream {<br /> private:<br /><br /> int* length;<br /><br /> private:<br /><br /> ByteCounterOutputStream( const ByteCounterOutputStream& );<br /> ByteCounterOutputStream operator= ( const ByteCounterOutputStream& );<br /><br /> public:<br /><br /> ByteCounterOutputStream( int* length, OutputStream* stream, bool own = false )<br /> : FilterOutputStream( stream, own ), length( length ) {<br /> }<br /><br /> virtual ~ByteCounterOutputStream() {}<br /><br /> protected:<br /><br /> virtual void doWriteByte( unsigned char value ) {<br /> <b>//(*length)++; removed because of length has been double sized</b><br /> FilterOutputStream::doWriteByte( value );<br /> }<br /><br /> virtual void doWriteArray( const unsigned char* buffer, int size ) {<br /><br /> (*length) += size;<br /> FilterOutputStream::doWriteArray( buffer, size );<br /> }<br /><br /> virtual void doWriteArrayBounded( const unsigned char* buffer, int size, int offset, int length ) {<br /><br /> (*this->length) += length;<br /> FilterOutputStream::doWriteArrayBounded( buffer, size, offset, length );<br /> }<br /><br /> };markqiuhttps://www.blogger.com/profile/06434471488299650538noreply@blogger.comtag:blogger.com,1999:blog-1000597103989045457.post-87349589078429126162011-04-26T20:28:15.855-07:002011-04-26T20:28:15.855-07:00It's really helpful. Thank you!It's really helpful. Thank you!markqiuhttps://www.blogger.com/profile/06434471488299650538noreply@blogger.comtag:blogger.com,1999:blog-1000597103989045457.post-51483893282579680862011-04-26T03:21:27.054-07:002011-04-26T03:21:27.054-07:00There's really not much at all to it, you simp...There's really not much at all to it, you simply add the URI option connection.useCompression=true to your client's URI and that's it. Its entirely possible given the right payload for zlib compression to double the size of the message body, using it for small messages is not recommended.Timhttps://www.blogger.com/profile/03370927021680126470noreply@blogger.comtag:blogger.com,1999:blog-1000597103989045457.post-51930967334857988752011-04-26T02:34:03.654-07:002011-04-26T02:34:03.654-07:00Is there any sample code about compression? I test...Is there any sample code about compression? I tested it and found the message size is doubled by setting usecompression. Could you help me?markqiuhttps://www.blogger.com/profile/06434471488299650538noreply@blogger.comtag:blogger.com,1999:blog-1000597103989045457.post-75539718996839164062010-03-16T01:47:44.573-07:002010-03-16T01:47:44.573-07:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.com