对bean绑定骆驼使用类型限定符

时间:2018-10-21 10:08:40

标签: apache-camel

引用文章 http://camel.apache.org/bean-binding.html

from("direct:myRoute1")
                .bean(new DemoRoute(), "test(Demo,Shape)")
               .end();


 from("direct:myRoute2")
                .bean(new DemoRoute(), "test(Demo,Vehicle)")
                .end();             




 interface Shape

 @Component
   class Circle implements Shape{
   }

interface Vehicle

 @Component
   class Bicycle implements Vehicle{
   }

我有2种重载的测试方法,但它给出了异常

 Exchange[ExchangePattern: InOnly, BodyType: String, Body: org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations 

0 个答案:

没有答案