camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: CAMEL Spring Equivalent of body().isInstanceOf(AddEndpointNotificationMessage.class)
Date Sat, 24 Apr 2010 07:41:28 GMT

I don't think current Spring DSL support this, but you can delegate the 
predict to a bean[1] method just like this

<bean name="myBean" class=YOUCLASS/>

<camelContext id="camel" xmlns="">
             <from uri="direct:start"/>
                     <method bean="myBean" method="isInstanceOfXXX"/>
                     <processor ref="foo"/>
                     <method bean="myBean" method="isInstanceOfXXX"/>
                     <processor ref="bar"/>



Gareth Collins wrote:
> Hello,
> I had originally written my CAMEL application using Java DSL. Now I want to
> convert to the Spring DSL. I am sure this conversion is obvious (I am new to
> Spring), but I haven't found in the documentation or on the web how to
> convert body().isInstanceOf(xxx.class) i.e.:
> .choice()
>     .when(body().isInstanceOf(xxx.class))
> 	 .process(...).stop()
>     .when(body().isInstanceOf(yyy.class))
>          .process(...).stop()
>     .when(body().isInstanceOf(zzz.class))
>          .process(...)
> .end()
> If someone could help me out and tell me how to do this, or point me to the
> section in the docs which show how to do this in Spring, it would be a
> really big help.
> Thanks very much in advance.
> regards,
> Gareth Collins

View raw message