我有路线:
from(SU_NAME)
.choice()
.when(STATUS_IS_OK)
.to("xslt:xsl/RemoveNode.xsl")
.split().tokenizeXML("Event", "Header").to(XP_NAME)
.otherwise()
.dynamicRouter(method(router, "slip"))
.end();
如果我移除分离器,一切正常,但在我的 route 使用它会给我:
java.lang.Error: Unresolved compilation problem:
The method otherwise() is undefined for the type ExpressionNode
我需要分离器作为路线的一部分,你能帮帮我吗?我知道应该选择 ChoiceDefinition 而不是 ExpressionNode,而不是我如何修改代码来获得它。
最佳答案
请参阅此常见问题解答 - 为什么我不能在 Java Camel 路由中使用 when/otherwise? http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
关于java - Camel 拆分器返回 ExpressionNode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13879208/