[rabbitmq-discuss] Producing an amqp message using python and consuming that same message using java

Emile Joubert emile at rabbitmq.com
Wed Dec 12 12:39:26 GMT 2012

Hi Julien,

On 12/12/12 12:01, Julien Martin wrote:
> pickled_me = pickle.dumps(me)

> Person me = (Person) template.receiveAndConvert("myqueue");

> I get a *class cast exception*

It looks like you are attempting to mix Python and Java serialisation
formats. RabbitMQ does not modify or process the message payload in any
way, so if you use incompatible formats then the broker won't solve that
problem for you.

I suggest you select a serialisation format that is supported by all
languages that need to interoperate. JSON, XML, Protocol Buffers and
YAML are popular choices, but there are many more, e.g. see

Once you have selected and implemented a compatible serialisation format
you should test it by serialising to and deserialising from files. Once
you have that working you can use a broker to pass messages in your
chosen serialisation format between clients.


More information about the rabbitmq-discuss mailing list