Re: Routing based on exchange IN message body clas

2011-04-19 Thread Claus Ibsen
On Tue, Apr 19, 2011 at 5:55 PM, Gert Villemos wrote: > Indeed, as you say and as its documented rather nicely on the wiki, the 'is' > operator works fine; > >  ${body} is org.hbird.exchange.type.Parameter' > > Just out of curiosity; why doesn't 'getClass.getName' work? What are the > limitations

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Gert Villemos
Indeed, as you say and as its documented rather nicely on the wiki, the 'is' operator works fine; ${body} is org.hbird.exchange.type.Parameter' Just out of curiosity; why doesn't 'getClass.getName' work? What are the limitations in allowed return types of a method? -- View this message in cont

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Romain Manni-Bucau
using another language like groovy for example can do the trick. I dont know if we can say the type to simple language. 2011/4/19 Gert Villemos > Its because the getClass() method doesnt return a String but a Class > object, i.e. creating an inheritance hierarchy and using accessor methods > ret

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Claus Ibsen
Hi You should use the is operator (its the instanceof check) http://camel.apache.org/simple ${body} is org.hbird.exchange.type.Parameter On Tue, Apr 19, 2011 at 5:37 PM, Gert Villemos wrote: > There seems to be a limitation that makes this impossible; the 'Simple' > evaluation doesnt seem abl

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Gert Villemos
Its because the getClass() method doesnt return a String but a Class object, i.e. creating an inheritance hierarchy and using accessor methods returning String from base classes works fine. Is there any way around this limitation? Do I need to tell 'Simple' what type is returned from getClass? --

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Gert Villemos
There seems to be a limitation that makes this impossible; the 'Simple' evaluation doesnt seem able to access methods that are inherited. I thus cant access the 'class', as the getClass method is inherited. The route ${body.getClass.getName} == 'org.hbird.exchange.type.Parameter'}

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Romain Manni-Bucau
same solution: http://camel.apache.org/content-based-router.html 2011/4/19 Gert Villemos > ... and if I'm using the Spring annotation, i.e. XML? > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Routing-based-on-exchange-IN-message-body-clas-tp4313282p4313325.html > Sent

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Gert Villemos
... and if I'm using the Spring annotation, i.e. XML? -- View this message in context: http://camel.465427.n5.nabble.com/Routing-based-on-exchange-IN-message-body-clas-tp4313282p4313325.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Routing based on exchange IN message body clas

2011-04-19 Thread Romain Manni-Bucau
Hi, you can do something like from(...)..choice().when(simple("${body.class == 'org.apache.MyClass'}")).to...otherwise().to()... - Romain 2011/4/19 Gert Villemos > Is there a a way to route an exchange based on the class hold in the IN > message body? > > I have a 'splitter' bean that cr