[rabbitmq-discuss] Message payload encoding

Helena Edelson hedelson at vmware.com
Tue Aug 2 13:13:38 BST 2011


Thanks Pete. Some payloads are Scala objects (serialized/deser by scalaxb/base64) and some plain xsl schemas (which some are doing base64 but I'd prefer UTF-8).
 
cheers,
Helena
________________________________________
From: Peter Ohler [peter at ohler.com]
Sent: Friday, July 29, 2011 8:12 PM
To: Helena Edelson
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Message payload encoding

If you don't mind I will take a shot at that one.

There are a few consideration that should be looked at. It is often the case that message size is not the most significant factor in performance, especially if the message size is small. Consider what it is you are sending. If it is a UTF-8 string then sending the string directly takes no preparation and is smaller than base64 encoding which also incurs and overhead in serialization and deserialization.

If what you are sending is an Java, Python, or Ruby object then there will be significant overhead in the serialization itself. For Ruby I wrote a fast object to XML serializer (Ox gem) that is much faster than the native Marshal encoding and that alone improved performance of our systems significantly.

Something else worth considering besides is how difficult it will be to debug and trace message exchanges. A binary format or base64 requires extra decoding to see what is in the body of a message while UTF-8 strings or XML can be viewed and understood directly. That is a real time saver during development and even in production when trying to fix a problem quickly.

-Pete

On Jul 30, 2011, at 3:00 AM, Helena Edelson wrote:

> Is there a preference, as in performance or other reason (please specify if so) for a message payload to be encoded for Rabbit as UTF-8 or base64?
> I have been doing UTF-8; just curious.
>
> Thanks,
> Helena
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list