You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Albert Strasheim <fu...@gmail.com> on 2008/08/07 01:08:17 UTC

Re: ACTIVEMQ-CPP Compression zlib

Hello,


alkatal wrote:
> 
> Hi im compressing a 6mb Textmessage using java ActiveMq. Compression works
> fine file is 204kb :)
> Prob is that ActiveMq-cpp does not support compression and i need to know
> wich kind of algorithm i have to use in c++ to decompress the TextMessage.
> Zlib, Xstream c++?
> 

I haven't looked at AMQCPP in a while, so maybe there is a better way to do
this.

My idea: You might consider sending a BytesMessage instead.

I think it would work something like this:

1. Build a chain of streams ending in a GZIPOutputStream wrapped around a
ByteArrayOutputStream.
2. Write to this stream.
3. Extract the compressed contents as a byte[] by calling toByteArray().
4. Put the resulting byte[] inside a BytesMessage.
5. Send the message to the C++ client.
6. Get the buffer from the BytesMessage on the C++ side and call the zlib C
library.

Hope this helps.

Cheers,

Albert





-- 
View this message in context: http://www.nabble.com/ACTIVEMQ-CPP-Compression-zlib-tp18761289p18861269.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.