On Tue, Oct 9, 2012 at 4:11 PM, Mark Doyle <markjohndo...@gmail.com> wrote:
> Hi all,
>
> Camel-mongodb has a set of provided type converters.
>
> @Converter
> public static DBObject fromStringToDBObject(String s) {
> ..blah blah
> }
>
> @Converter
> public static DBObject fromAnyObjectToDBObject(Object value) {
> ...blah blah
> }

This should be a @FallbackConverter instead. You should never convert
from Object -> XXX.
Instead it should be fallback and decided at runtime whether to convert or not.


>
>
> I'm trying to run a query which means sending a json string. After some
> debugging it looks like Camel selects the fromAnyObjectToDBObject converter
> rather than the fromStringToDBObject converter. I''m not sure of the
> consequences of this yet, with regards to the the mongodb component, but it
> did raise the question on how Camel deals with converters that could
> overlap given inheritance, a String is an Object after all.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to