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

Julien Martin balteo at gmail.com
Wed Dec 12 13:30:33 GMT 2012


Hi Emile,
You put me in the right direction. Thanks!
Using JSon I now get this from Spring:

Exception in thread "main"
org.springframework.amqp.support.converter.MessageConversionException:
failed to convert Message content. Could not resolve
 __TypeId__ in header
at
org.springframework.amqp.support.converter.DefaultJavaTypeMapper.retrieveHeader(DefaultJavaTypeMapper.java:104)
at
org.springframework.amqp.support.converter.DefaultJavaTypeMapper.toJavaType(DefaultJavaTypeMapper.java:53)
at
org.springframework.amqp.support.converter.JsonMessageConverter.fromMessage(JsonMessageConverter.java:118)
at
org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert(RabbitTemplate.java:425)
at trc.suivi.amqp.Consumer.main(Consumer.java:12)

Do you have any idea what this means?

Regards,
J.

2012/12/12 Emile Joubert <emile at rabbitmq.com>

>
> 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
> http://en.wikipedia.org/wiki/Category:Data_serialization_formats
>
> 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.
>
>
>
> -Emile
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121212/24aade5c/attachment.htm>


More information about the rabbitmq-discuss mailing list