camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakub Korab <jakub.korab.li...@gmail.com>
Subject Re: Modifying a shipped TypeConverter
Date Tue, 20 Jan 2015 15:29:53 GMT
I haven't tried this, so it's just conjecture, but you could try to
remove the offending type converter from the TypeConverterRegistry and
replace it with your own:

|CamelContext context = ...|
|TypeConverterRegistry converterRegistry =
context.getTypeConverterRegistry();
||converterRegistry.remove|||TypeConverter|(DBObject.class, Object.class);
converterRegistry.addTypeConverter||(DBObject.class, Object.class, new
FixedTypeConverter());|

See:
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/TypeConverterRegistry.html#removeTypeConverter%28java.lang.Class,%20java.lang.Class%29

Jakub

On 20/01/15 14:50, James Green wrote:
> The mongodb component uses Jackson to marshal Object to DBObject. The
> trouble is that Date becomes long due to the default configuration of
> Jackson.
>
> Is it possible to change this by obtaining that Jackson instance and
> reconfiguring it?
>
> Or must be add a TypeConvertor for our specify type to the registry?
>
> Thanks,
>
> James
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message