Back to Basics : Apache Camel Routes and Direct Component

前端 未结 1 1059
广开言路
广开言路 2021-01-13 17:28

I am bit confused about Camel routes and its two endpoints : Direct and Seda. Well let\'s say i have a route like this :

public void configure()
{
 from(\"di         


        
相关标签:
1条回答
  • 2021-01-13 18:01

    The direct component runs in the thread of the caller. Simplified, it's as a regular java method invocation. Multiple messages can run through the route as long as multiple threads are calling the direct endpoint.

    When invoking the SEDA (or VM) endpoint, you message is put on a queue (in memory). Another thread (in the route) picks messages from the queue one by one and processes them. You can configure how many threads the seda consumer should have by setting the concurrentConsumers option. By default, the one thread consuming messages makes sure only one message at a time is processed no matter how many threads are producing to this route.

    It boils down to your statement

    in a instant I send multiple different messages to this route

    If this means different threads, or just from one single thread in a sequence,

    0 讨论(0)
提交回复
热议问题