[英]calling a new class on filter tag apache camel
I have this code on my router class 我的路由器类上有此代码
from("seda:singleInvoicesChannel")
.filter(new LowEnoughAmountPredicate())
.to("seda:filteredInvoicesChannel");
now iam trying to transfer it on my camel-context.xml with this 现在我试图与此转移到我的camel-context.xml
<route id="singleInvoicesChannel">
<from uri="seda:singleInvoicesChannel"/>
<filter>
</filter>
<to uri="seda:filteredInvoicesChannel"/>
</route>
my question is what will i put inside the filter tag to fulfill the .filter(new LowEnoughAmountPredicate());. 我的问题是我将在filter标记内放入什么以实现.filter(new LowEnoughAmountPredicate());。
I'm not fan of this Springish DSL but I just guess it could be something like this: 我不喜欢这种Springish DSL,但我只是猜测可能是这样的:
<bean id="filterBean" class="LowEnoughAmountPredicate"/>
<route id="singleInvoicesChannel">
<from uri="seda:singleInvoicesChannel"/>
<filter>
<custom ref="filterBean" />
</filter>
<to uri="seda:filteredInvoicesChannel"/>
</route>
The working Spring solution looks like that: 正常的Spring解决方案如下所示:
<bean id="myPredicate" class="LowEnoughAmountPredicate"/>
<route id="singleInvoicesChannel">
<from uri="seda:singleInvoicesChannel"/>
<filter>
<method ref="myPredicate"/>
<to uri="seda:filteredInvoicesChannel"/>
</filter>
</route>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.