Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camel parallel processing options

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/ using SEDA routes

    from("A")
    .split(body())
    .to("seda:B");

    from("seda:B?concurrentConsumers=4")
    .routeId("MySEDATestRoute")
    .to("C")
    .end();

2/ using parallel processing

   from("A")
    .split(body())
    .parallelProcessing()
    .to("C");

3/ using threads

    from("A")
    .split(body())
    .threads()
    .to("C");

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).

If I don't pass any parameters to the method thread will the behavior of methods 2 and 3 be the same ?

Thanks in advance,

Regards

like image 954
user3416249 Avatar asked Nov 04 '14 13:11

user3416249


1 Answers

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.

like image 149
Willem Jiang Avatar answered Oct 07 '22 20:10

Willem Jiang