Apache camel 如何在camel中连接过滤器内的抽头
我对camel还不熟悉,我必须在给定camel应用程序的路由中连接一个过滤器。应用程序只使用xml风格。因为我可以在任何标记中添加Apache camel 如何在camel中连接过滤器内的抽头,apache-camel,Apache Camel,我对camel还不熟悉,我必须在给定camel应用程序的路由中连接一个过滤器。应用程序只使用xml风格。因为我可以在任何标记中添加(我没有得到错误),我想这应该是可能的?! 以下是带有导线抽头的路线: <route id="cep-output-postpaid" autoStartup="true"> <from uri="someUri" /> <log message="Output: ${body}"
(我没有得到错误),我想这应该是可能的?!
以下是带有导线抽头的路线:
<route id="cep-output-postpaid" autoStartup="true">
<from
uri="someUri" />
<log message="Output: ${body}" />
<to
uri="file:someFile?fileName=result.csv&fileExist=Append"></to>
<filter>
<method ref="filterAfterDownTime" method="numberOfDaysToFilter(${body}, 100)" />
<process ref="processor1"></process>
<throttle timePeriodMillis="10000">
<constant>40</constant>
<wireTap uri="direct:wireTap"/>
<to uri="someWsdlService"></to>
</throttle>
<process ref="processor1"></process>
</filter>
<log message="Done CEP Engine Output" />
</route>
问题是构造函数和方法都没有被调用,但rout正在运行并生成其输出。
有什么想法吗?提前谢谢
其他问题:
这里如何使用“seda”?(我想将窃听与处理分离)
和
是否可以为wiretap提供一个参数(例如,wiretap的文件路径)啊如果要调用bean上的方法,应该使用bean组件 所以改变
<wireTap uri="direct:wireTap"/>
到
记住,你可以给豆子任何你想要的id,你不必称它为wireTap。Thx这很快。在一些示例中,我看到了“seda”(我认为这将解耦wirtap),如何使用此uri=“seda:bean:wiretap”进行窃听?不能在同一uri中同时使用seda和bean组件。seda通常用于在路由之间进行切换,因此您将路由到seda队列,然后另一条路由继续该消息。
public class WireTap {
public PcrfEdrPostpaidWireTap(){
System.out.println("wiretap constructor called");
}
@Handler
public void handleBody(String body){
System.out.println("Wiretap says:" + body);
}
}
<wireTap uri="direct:wireTap"/>
<wireTap uri="bean:wireTap"/>