You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Steffen Larsen <zo...@gmail.com> on 2014/02/21 13:15:07 UTC
Handling objects in the rabbitmq component
Hi There,
I have a rabbitmq component that should consume an java POJO object. It works quite fine outside of camel, where I can handle the message as an object (MyObject, done in the spring-rabbitmq lib).
When I send my object down to camel it seems that I can’t convert it into an object?
Roughly my route is like this:
from("rabbitmq://localhost/video”)
.process(new VideoAssetProcessor())
How can I achieve this? Can I use convertBodyTo(MyObject.class)?
or should I send it as json instead of an object and the unmarchal it by doing .unmarshal().json(JsonLibrary.Gson, MyObject.class) ?
I can see that the rabbitmq consumer only takes a byte array.
-Cheers!
/Steffen
Re: Handling objects in the rabbitmq component
Posted by Steffen Larsen <zo...@gmail.com>.
Hi Guys,
Does nobody have any ideas how to parsing an object into rabbitmq component?
-Cheers
/Steffen
On 21 Feb 2014, at 13:15, Steffen Larsen <zo...@gmail.com> wrote:
> Hi There,
>
> I have a rabbitmq component that should consume an java POJO object. It works quite fine outside of camel, where I can handle the message as an object (MyObject, done in the spring-rabbitmq lib).
> When I send my object down to camel it seems that I can’t convert it into an object?
>
> Roughly my route is like this:
>
> from("rabbitmq://localhost/video”)
> .process(new VideoAssetProcessor())
>
> How can I achieve this? Can I use convertBodyTo(MyObject.class)?
> or should I send it as json instead of an object and the unmarchal it by doing .unmarshal().json(JsonLibrary.Gson, MyObject.class) ?
>
> I can see that the rabbitmq consumer only takes a byte array.
>
> -Cheers!
>
> /Steffen