camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: What is recommended way of running many route sets in one application?
Date Fri, 16 Oct 2009 05:40:31 GMT
On Wed, Oct 14, 2009 at 4:21 PM, Vladimir Okhotnikov
<vokhotnikov@gmail.com> wrote:
>
> Hi,
>
> in our setup we would like to package different set of routes for different
> tasks into one java-based windows service. For example, we have one task to
> import files from some ftp to one clients database, another to import data
> from web-based repotys into another app db and so on. The question is - what
> is the recommended way of doing this in the Camel2?
>

There is no single true solution.

> One option is to just include multiple RouteBuilder subclasses into the
> project and be done with it. This however raises some questions: am I
> correct to assume that global definitions like interceptors and error
> handler would be shared by all routes? Also, there is a chance of name
> clashes for direct endpoints name - for example I could accidentally use
> "direct:initiateImport" endpoint in 2 separate route sets, which would not
> be good - isn't there?
>

Yeah direct endpoints are Camel context wide. You can use that to link
2 separate routes if you want.
If the 2 routes must be fully separated then of course the endpoint
names must be unique.

> Another option is to use multiple camel contexts in a single spring context
> - would this resolve the global definitions and naming clash issues? I tried
> to search the list (and the net in general) but there turned up little
> information about this. Does anybody use the camel this way? Are there any
> performance/scalability/whatever problems anticipated, if we expect up to
> dozen of camel contexts and more?
>

Global mean per CamelContext. There is nothing that is Super global
and works on all CamelContexts.

There is a ticket though to add this to Camel in some form of template
routes etc.
https://issues.apache.org/activemq/browse/CAMEL-1919

Part of it is already done in the Java DSL. The Spring DSL is missing.
This should also help with reusing error handler settings,
interceptors etc. among multiple route builders.

This will also solve the naming clash issue as all endpoints are only
global within the CamelContext.


> Perhaps there are some other options I do not see?
>
> Regards,
> Vladimir Okhotnikov
>
>
> --
> View this message in context: http://www.nabble.com/What-is-recommended-way-of-running-many-route-sets-in-one-application--tp25892016p25892016.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message