You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by tanshul22 <ta...@hotmail.com> on 2008/04/18 01:23:59 UTC

Reducing the size of messages

I have been trying to reduce the overhead an activemq message carries.

ActiveMQTextMessage {commandId = 0, responseRequired = false, messageId =
null, originalDestination = null, originalTransactionId = null, producerId =
null, destination = null, transactionId = null, expiration = 0, timestamp =
0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null,
replyTo = null, persistent = false, type = null, priority = 0, groupID =
null, groupSequence = 0, targetConsumerId = null, compressed = false, userID
= null, content = null, marshalledProperties = null, dataStructure = null,
redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties =
false, readOnlyBody = false, droppable = false, text = Hello World}

I wonder why does a message carry all these feilds due to which its size
increases even more than 10 times.

Is there a way to get rid of these overheads.

Secondly, i am using jms.useCompression=true but still my messages show a
compression = false.
Does anybody know why?

Thanks,
Anshul
-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-messages-tp16757781s2354p16757781.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Reducing the size of messages

Posted by Jim Gomes <e....@gmail.com>.
That isn't completely unexpected.  To verify, create a text file with
"hello world" and the ZIP it.  The zip file will most likely be bigger
than the original uncompressed text file.  Compression is a trade off
and should be carefully measured.



On 4/18/08, tanshul22 <ta...@hotmail.com> wrote:
>
> This is weird.
> I setUseCompression on both producer and consumer side and this inflates my
> message size.
> When the compression is false on the producer side, my message size is
> smaller, irrespective of compression being true or false on consumer.
> I am sending a textMessage "Hello World".
>
> Wonder why is compression working in the opposite direction?
>
>
> rajdavies wrote:
> >
> >
> > On 18 Apr 2008, at 00:23, tanshul22 wrote:
> >
> >> Secondly, i am using jms.useCompression=true but still my messages
> >> show a
> >> compression = false.
> >> Does anybody know why?
> >
> > Do you check that property from the sender after you've sent it?
> >
> > cheers,
> >
> > Rob
> >
> > http://open.iona.com/ -Enterprise Open Integration
> > http://rajdavies.blogspot.com/
> >
>
> --
> View this message in context:
> http://www.nabble.com/Reducing-the-size-of-messages-tp16757781s2354p16763551.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: Reducing the size of messages

Posted by tanshul22 <ta...@hotmail.com>.
This is weird.
I setUseCompression on both producer and consumer side and this inflates my
message size.
When the compression is false on the producer side, my message size is
smaller, irrespective of compression being true or false on consumer.
I am sending a textMessage "Hello World".

Wonder why is compression working in the opposite direction?


rajdavies wrote:
> 
> 
> On 18 Apr 2008, at 00:23, tanshul22 wrote:
> 
>> Secondly, i am using jms.useCompression=true but still my messages  
>> show a
>> compression = false.
>> Does anybody know why?
> 
> Do you check that property from the sender after you've sent it?
> 
> cheers,
> 
> Rob
> 
> http://open.iona.com/ -Enterprise Open Integration
> http://rajdavies.blogspot.com/
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-messages-tp16757781s2354p16763551.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Reducing the size of messages

Posted by Rob Davies <ra...@gmail.com>.
On 18 Apr 2008, at 00:23, tanshul22 wrote:

>
> I have been trying to reduce the overhead an activemq message carries.
>
> ActiveMQTextMessage {commandId = 0, responseRequired = false,  
> messageId =
> null, originalDestination = null, originalTransactionId = null,  
> producerId =
> null, destination = null, transactionId = null, expiration = 0,  
> timestamp =
> 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId =  
> null,
> replyTo = null, persistent = false, type = null, priority = 0,  
> groupID =
> null, groupSequence = 0, targetConsumerId = null, compressed =  
> false, userID
> = null, content = null, marshalledProperties = null, dataStructure =  
> null,
> redeliveryCounter = 0, size = 0, properties = null,  
> readOnlyProperties =
> false, readOnlyBody = false, droppable = false, text = Hello World}
>
> I wonder why does a message carry all these feilds due to which its  
> size
> increases even more than 10 times.
This fields are optimized on-the-wire - some values are even cached -  
we've spent along time optimizing messaging performance.
These properties are there either because ActiveMQ needs them or they  
are required by the JMS spec
>
>
> Is there a way to get rid of these overheads.
>
> Secondly, i am using jms.useCompression=true but still my messages  
> show a
> compression = false.
> Does anybody know why?

Do you check that property from the sender after you've sent it?
>
>
> Thanks,
> Anshul
> -- 
> View this message in context: http://www.nabble.com/Reducing-the-size-of-messages-tp16757781s2354p16757781.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/




Re: Reducing the size of messages

Posted by ttmdev <jo...@ttmsolutions.com>.
Re compression; if your producer has not set useCompression to true, then the
'compressed' message property will be set to false when viewed by your
consumer.  If I'm not mistaken, the default compression algorithm used is
the default “DEFLATE” (gzip) algorithm. More on this algorithm can be found
here, http://en.wikipedia.org/wiki/DEFLATE

Joe
Goto www.ttmsolutions.com for a free ActiveMQ user guide


tanshul22 wrote:
> 
> I have been trying to reduce the overhead an activemq message carries.
> 
> ActiveMQTextMessage {commandId = 0, responseRequired = false, messageId =
> null, originalDestination = null, originalTransactionId = null, producerId
> = null, destination = null, transactionId = null, expiration = 0,
> timestamp = 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0,
> correlationId = null, replyTo = null, persistent = false, type = null,
> priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null,
> compressed = false, userID = null, content = null, marshalledProperties =
> null, dataStructure = null, redeliveryCounter = 0, size = 0, properties =
> null, readOnlyProperties = false, readOnlyBody = false, droppable = false,
> text = Hello World}
> 
> I wonder why does a message carry all these feilds due to which its size
> increases even more than 10 times.
> 
> Is there a way to get rid of these overheads.
> 
> Secondly, i am using jms.useCompression=true but still my messages show a
> compression = false.
> Does anybody know why?
> 
> Thanks,
> Anshul
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-messages-tp16757781s2354p16758966.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.