Extract the name of the Method from a Bean invokation.

2013-07-10 Thread Cristiano Costantini
Hi All, I have a Camel Proxy that pushes BeanInvokation exchanges to a camel route, and I want to route these messages depending on the method name that is invoked. Is there any way to extract this information and put into an header so to use it in a choice? For example, considering the

Re: Extract the name of the Method from a Bean invokation.

2013-07-10 Thread Cristiano Costantini
mmm, it seems that simple${body.method.name}/simple works: setHeader headerName=methodName simple${body.method.name}/simple /setHeader Any comment about this solution? (is it good?) What happens if the body is not of class org.apache.camel.component.bean.BeanInvocation? Is there a way to check

Re: Extract the name of the Method from a Bean invokation.

2013-07-10 Thread Claus Ibsen
There is a ? operator, so you can do simple${body?.method?.name/simple Then it will be null if the body if the body doesnt have a getMethod().getName() There is also a bodyAs(type) to use the Camel type converter. On Wed, Jul 10, 2013 at 4:48 PM, Cristiano Costantini

Re: Extract the name of the Method from a Bean invokation.

2013-07-10 Thread Cristiano Costantini
, I would need exactly that, but I've tested sending a string with a producer template and I got this error: Failed to invoke method: ?.method?.name on null due to: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: method on null due to: