camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Jackson/JSON unmarshall
Date Thu, 11 Jul 2013 06:31:19 GMT

No this is currently not support by data formats. Though we have a
JIRA ticket to allow bridging data formats from a component, in a
future release.

Then you can use recipient list, eg something a like

Currently you can use a java processor / bean and then use java code
to create the json data format, and invoke its unmarshal operation
from there.

On Mon, Jun 24, 2013 at 11:59 PM, Mike Oxford <> wrote:
> Hi all.
> Given that you can use Jackson to unmarshall to "unmarshalTypeName="
> (which works for a 1:1 mapping) how does one go about "dynamically
> unmarshalling" a JSON document to "N-possible classes?"
> eg, full protocol work, based on a piece of the JSON itself.
> I can build something using the java DSL, or letting Jackson unmarshal
> to a Map and then building POJOs by hand, but I'm wondering if there's
> a better way, ideally, using the Spring XML syntax.
> Something like ..
>         <route id="incomingJSON">
>             <from ref="jsonListener" />
>             <unmarshal ref="jsonDF"
> unmarshalTypeRef="com.mypackage.ProtocolHandler"
> method="getPOJOClass"/>
>             <to ref="seda:routeMessage" />
>         </route>
> This way I can use a bean to determine which class to map the JSON to,
> instead of hardcoding to a single class.
> Thanks,
> -mox

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message