camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickaroni <>
Subject Over-riding JSON deserializers/serializers in Camel w/o using annotations
Date Fri, 12 Sep 2014 21:35:37 GMT

JSON libraries like Jackson and XStream provide ways of overriding the
serializers/deserializers that get used for various specific object types.

[While you can always hand-annotate code (e.g. with @JsonSerializer) to use
custom serializers and deserializers, that can be cumbersome and invasive.]

Some frameworks like Spring provide handy ways to do override the object to
serializer/deserializer mappings:

How can I do the same kind of thing in Camel to override the converters
found in the the dataFormats section of camelContext?

e.g. How do can I change the converters that get used to convert to/from
MyObj1 and MyObj2 below?
          <json id="MyObj1MarshallingJSON" 
unmarshalTypeName="com.blah.bleh.MyObj1"  library="Jackson" />
          <json id="MyObj2MarshallingJSON" 
unmarshalTypeName="com.blah.bleh.MyObj2"  library="XStream" />


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message