Interessting idea. But currently you can not pass in additional parameters with the bean component.
Its purpose is to invoke a bean with your Exchange/Message as parameters. But I can see a valid point in having some additional parameters provided. However as the JVM runtime dont keep the parameter name we only have the types (and the order) in the parameter list and wont be able to match against a parameter name from the URI.
We could support this by bean binding using annotations. We could add a new annotation to allow you to specify additional parameters and then you can mark them in the method.
And maybe we can support a non annotation solution if there is only one extra parameter and only one parameter provided in the URI.
So, I think that it will be useful.
In addition to way show in link http://camel.apache.org/bean-binding.html, we had problem in our application where we have two parameter for method which both are string.
We have managed it to solve by using below
Above picks the value from MessageContentList in the order specified. We can simple expression in a filter to check the size of list to avoid ArrayIndexOutOfBound Exception.
Edited by: balakumar1982 on Nov 11, 2013 12:07 PM