Hi direct is like direct method invocation in java code, eg like calling a method on a java class. So this call happens with the current thread.
So like in java if you have concurrent threads calling the same method, then this happens concurrently. And the same for the Camel direct component. SEDA has a queue in between so that allows losly coupling. On Thu, May 2, 2013 at 11:39 AM, anand_tech <anand29...@gmail.com> wrote: > 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("direct:services") > .process(//Some processing here) > .to("http://ThirdPartyServers") > } > > On top of this I have a rest web service which receives several requests, > does some processing and then hands over the message to this route to get > response from some third party servers. I have instantiated Camel Context > through Spring framework like this : > > > <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 is that in a instant I send multiple different messages to > this route. Now Camel documentation says that direct component is invoked in > single thread and is synchronous. So will all the messages be processed > concurrently or one by one processing will happen ? > > Also if i change the direct component to seda, will it make any difference ? > > Also regarding the same Direct and Seda components. Lets say my route is now > 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 direct component from different threads, so > these messages would be processed concurrently. As you can see in the above > route, direct component sends the message to seda component. So now will > there be only one thread of seda component which will process all the > different 5 messages? Meaning in the end all the messages will be processed > one by one ? > > TIA > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Back-to-Basics-Apache-Camel-Routes-and-Direct-Component-tp5731899.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen