2016-12-06 30 views
0

是否可以使用未绑定到任何交换机的bean,并在Camel拦截过程中触发某种服务启动方法?从骆驼调用Bean方法而无需绑定/处理交换

interceptFrom("a").bean(service, "method") 

与方法看起来像

public void method() { 
    //just do something that has nothing to do with the exchange 
} 

骆驼2.12.2

例外我得到的是:

Caused by: org.apache.camel.InvalidPayloadException: No body available of type: java.util.function.Function but has value: ... 

,另一个在同一个堆栈跟踪:

Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: ... to the required type: java.util.function.Function with value ... 
+0

我认为你可以用比输入这个问题更快的速度进行测试。 – rmlan

+0

我用拦截测试了这一点,它打破了一切。实际上拦截应该是问题 – javanoob

+0

“它打破了一切”的一部分 - 这是什么意思? – rmlan

回答

0

我可能可以用InOnly模式做到这一点,但我仍然不确定。