[ 
https://issues.apache.org/jira/browse/CAMEL-8463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-8463.
--------------------------------
    Resolution: Won't Fix
      Assignee: Claus Ibsen

The binding is already flexible and complicated. And its more for binding non 
Camel types. If you want Exchange then just have that as a single-arg.

> Have Camel Support Method Overloading With Implicit Binding Of Exchange
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-8463
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8463
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Joe Fernandez
>            Assignee: Claus Ibsen
>            Priority: Minor
>
> Allow overloading of methods that accept a Camel exchange.
> Suppose one defines a bean called “helloBean” with the following two methods:
> {code}
> public void hello(String first) 
> public void hello(String first, String last) 
> {code}
> The following Camel route will distinguish one method from the other. 
> {code}
> from("timer://foo?repeatCount=1")
> .beanRef("helloBean", "hello('Wilma')")
> .beanRef("helloBean", "hello('Wilma','Flintstone')");
> {code}
> Now alter the two methods to have them accept a Camel Exchange, as follows:
> {code}
> public void hello(String first, Exchange ex1)
> public void hello(String first, String last, Exchange ex1) 
> {code}
> The same Camel route will not be able to distinguish one method from the 
> other. The route will throw either an AmbiguousMethodCallException or 
> ParameterBindingException exception. 
> If, on the other hand, you remove one of the methods, and alter the route 
> accordingly, then the route will work just fine and the exchange will be 
> implicitly passed to the method. For example, 
> {code}
> public void hello(String first, String last, Exchange ex1) 
> from("timer://foo?repeatCount=1")
> .beanRef("helloBean", "hello('Wilma','Flintstone')");
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to