camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Tudor <scorpioncsru...@yahoo.com>
Subject RabbitMQ convert body
Date Tue, 02 Dec 2014 15:23:00 GMT
Hi,

I recently upgraded from using bluelock with camel 1.x to camel 2.14 and
rabbitmq component.

My route:
       public static class CustomRouteBuilder extends RouteBuilder {
       public static String toEndPoint =
"rabbitmq://localhost/someExchange?queue=queueName&routingKey=customKey&exchangeType=direct&durable=false&autoDelete=true";
    @Override
    public void configure() throws Exception {
      from("some route")
      .id("customId")
      .setExchangePattern(ExchangePattern.InOut)
      .unmarshal().json(JsonLibrary.Jackson, Firm.class)
      .to(toEndPoint );
   }

When I use this route i get the following exception:
org.apache.camel.InvalidPayloadException: No body available of type: byte[]
but has value: {Firm :{}}
I think the problem is when the route is trying to send to the toEndPoint.
It does the unmarshalling without problems.
The toEndPoint is the starting point for another route.
How can I configure the second route to take as body custom objects instead
of byte[]?

Thank you,
    Tudor

    



--
View this message in context: http://camel.465427.n5.nabble.com/RabbitMQ-convert-body-tp5759955.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message