What is the difference between "seda + concurrentConsumers" and "direct + threads",

Apache Camel offers two solutions for using a thread pool:

from("seda:stageName?concurrentConsumers=5").process(...)

and

from("direct:stageName").thread(5).process(...)

I would like to know what is the difference between these two solutions? Are these just two kinds of spelling of the same or not? What are the use cases?

+4
source share
2 answers

SEDA Component

seda: component provides SEDA asynchronous behavior so that messages are exchanged for BlockingQueue, and consumers are called in a separate thread for the producer.

Direct component

direct: component , . JVM, , .

- , / , .

, ,

- from ( "seda: stageName? concurrentConsumers = 5" ). process (...)

- from ( "direct: stageName" ). thread (5).process(...)

, 5 , Concurrent Consumers, , ( 5) Thread Pool.

+9

SEDA , . :

from ("seda: stageName? concurrentConsumers = 5"). process (...) , , / , .

, SEDA :

. ( ": ") (5).process(...)

BlockQueues: SEDA, , , . Direct , , . :

. ( ": ") (5).process(...)

, SEDA, concurrentConsumers.

0

All Articles