I am a little confused about the routes of the Camel and its two end points: Straight and Seda. Well, let's say I have a route like this:
public void configure() { from("direct:services") .process(
In addition, I have a leisure web service that receives a few requests, does some processing, and then sends a message to this route to get a response from some third-party servers. I created an instance of Camel Context through the Spring framework as follows:
<camelContext id="appCamelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" streamCache="true"> <propertyPlaceholder id="properties" location="classpath:camel.properties" /> <camel:routeBuilder ref="oneRouteBuilder" /> <camel:routeBuilder ref="photosRouteBuilder" /> </camelContext>
Now the question arises that in an instant I send several different messages to this route. Now, the Camel documentation says that the direct component is called on a single thread and is synchronous. So will all messages be processed simultaneously or in turn?
Also, if I change the direct component to seda, will it have any meaning?
TIA
Update [after Petterโs answer] : Although Petterโs answer clarified, I have new doubts about the same Direct and Seda components. Let's say my route now looks like this:
public void configure(){ from("direct:services") .choice() .when("some predicate here-Predicate1") .to("seda:predicate1") .otherwise() .to("seda:fallback") .end(); from("seda:predicate1") .process("some processing") .to("http://ThirdPartyServers"); from("seda:fallback") .process("some processing") .to("jms:fallbackqueue"); }
Now, if I send 5 messages to a direct component from different threads, so that these messages will be processed simultaneously. As you can see from the above route, the direct component sends a message to the seda component. So now there will be only one seda component thread that will handle all 5 different messages? In the end, all messages will be processed one after another?