骆驼并行处理选项 [英] Camel parallel processing options
问题描述
我正在使用具有骆驼2.10的RedHat Fuse Service Works中的骆驼路线.
I am working on Camel routes in RedHat Fuse Service Works which has Camel 2.10.
我想知道以下实现之间的区别:
I would like to know the differences between the following implementations:
1/使用SEDA路线
1/ using SEDA routes
from("A")
.split(body())
.to("seda:B");
from("seda:B?concurrentConsumers=4")
.routeId("MySEDATestRoute")
.to("C")
.end();
2/使用并行处理
from("A")
.split(body())
.parallelProcessing()
.to("C");
3/使用线程
from("A")
.split(body())
.threads()
.to("C");
根据我所看到的,方法3(线程)允许配置线程池大小,这似乎与解决方案1(SEDA)的"concurrentConsumers"相同.
From what I've seen the method 3 (threads) allows to configure the thread pool size which seems the same as "concurrentConsumers" of solution 1 (SEDA).
如果我不将任何参数传递给方法线程,方法2和3的行为是否相同?
If I don't pass any parameters to the method thread will the behavior of methods 2 and 3 be the same ?
预先感谢
致谢
推荐答案
您可以在1),3)中设置线程号,但是1)仍然可以从其他路由接收消息,就像from(xxx).to ("seda:B"). 2)您需要设置ExecutorService(或ThreadPool),否则parallelProcessing将无法正常工作.
You can setup the thread number in 1), 3), but 1) can still receive the message from other route which just like from(xxx).to("seda:B"). 2) You need to setup the ExecutorService (or ThreadPool), otherwise the parallelProcessing won't work as you want.
这篇关于骆驼并行处理选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!