Camel 并行处理选项 [英] Camel parallel processing options

查看:44
本文介绍了Camel 并行处理选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Camel 2.10 的 RedHat Fuse Service Works 处理 Camel 路由.

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 一样从其他路由接收消息(色达: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.

这篇关于Camel 并行处理选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆