You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Camel Guy (JIRA)" <ji...@apache.org> on 2014/09/12 23:20:33 UTC

[jira] [Created] (CAMEL-7811) Does every route that starts with the Direct component have its own thread?

Camel Guy created CAMEL-7811:
--------------------------------

             Summary: Does every route that starts with the Direct component have its own thread?
                 Key: CAMEL-7811
                 URL: https://issues.apache.org/jira/browse/CAMEL-7811
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Camel Guy
            Priority: Minor


All programming environments must support decomposition if they are to overcome the ravages of time. It is very convenient in Camel to define routes as subroutines. As a particular route is reused considerably and is even copy and pasted across camel-based projects (this happens especially when Spring DSL is used), perhaps the functionality should be refactored into a Java class (easy) or a Camel component (harder). But that is a different subject. 

Again, routes are very convenient for encapsulating arbitrarily complex logic. However, the downside to factoring a Camel program into reusable routes is that it appears that one Java thread is dedicated to every route, even when they start with the "Direct" component, which is commonly advertised in Camel literature as being the most efficient way for a route to invoke another.

If it is true that every route that starts with the Direct component has its own thread, then these routes consume thread resources and are also expensive to invoke because calling across thread boundaries ultimately requires some form of synchronization.

I may be missing an important aspect of Camel messaging, such as in vs. in/out. I would like see Camel's architects discuss this topic so that I can learn the best way to build complex Camel programs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)