Hi You should use the is operator (its the instanceof check) http://camel.apache.org/simple
<simple>${body} is org.hbird.exchange.type.Parameter</simple> On Tue, Apr 19, 2011 at 5:37 PM, Gert Villemos <gville...@yahoo.de> wrote: > 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 > > <simple>${body.getClass.getName} == > 'org.hbird.exchange.type.Parameter'}</simple> > > Thus fails with the error trace > > Caused by: org.apache.camel.component.bean.MethodNotFoundException: Method > with name: getClass not found on bean: > org.hbird.exchange.type.Parameter@2d83e895. Exchange[Message: > org.hbird.exchange.type.Parameter@2d83e895] > at > org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:164) > at > org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:150) > at > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103) > at > org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74) > at > org.apache.camel.language.bean.BeanExpression$InvokeProcessor.process(BeanExpression.java:136) > at > org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:207) > > I have tried creating my own accessor method on my class and then the route > works. It only seem because the getClass is an inherited method, or maybe > because it doesnt return a string but that is not what the exception states. > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Routing-based-on-exchange-IN-message-body-clas-tp4313282p4313583.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/