activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Strasheim <full...@gmail.com>
Subject Re: ACTIVEMQ-CPP Compression zlib
Date Wed, 06 Aug 2008 23:08:17 GMT

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.


Mime
View raw message