camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From georgiosgeorgiadis <>
Subject Re: Routing to a method of an object with more than one parameters
Date Tue, 04 Mar 2008 15:32:46 GMT


The idea with org.apache.camel.MethodName" set to the method name to invoke
and the
body as the Object[] arguments sounds good, but if the method has more than
one formal parameters (not annotations) it throws an error:

No expression available for method: public java.lang.Object
MyClass.callme(java.lang.Object,java.lang.String) which already has a body
so ignoring parameter: 1 so ignoring method

Anyway, I will use still the BeanProcessor.METHOD_NAME as header but my
custom processor will ignore annotations as all objects that we need to call
are old-school pojos.



James.Strachan wrote:
> On 04/03/2008, georgiosgeorgiadis <> wrote:
>>  Thanks James, at the end, yes, I decided to do it with the type
>> converter
>>  which gives me more control over what is called and
>>  what is passed around. How I have decided, as these objects that i am
>> using
>>  have multiple methods, is that I pass the methodName in the message's
>> header
>>  as "@method" and with the method parameters passed as an array of
>> objects as
>>  the message body.
>>  The type converter will use reflection to resolve actual method
>> invocations
>>  and propagate correctly and returning correctly.
> Great.  There is a BeanInvocation object you can use as the payload
> BTW which tries to do that too; though currently that takes a Method
> and Object[] arguments.
> Another approach is to send a message with the header
> "org.apache.camel.MethodName" set to the method name to invoke and the
> body as the Object[] arguments and it should then work using the
> existing bean invocation?
>>  Thank you very much.
> No problem!
> -- 
> James
> -------
> Open Source Integration

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message