camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elvio Caruana (ecaruana)" <ecaru...@cisco.com>
Subject RE: Reusable route definitions?
Date Tue, 16 Sep 2014 10:25:30 GMT
Hi Claus, 

The danger of defining "common" routes in an abstract route builder class means that the routes
will be "instantiated" every time a route builder is created , leading to failed route exceptions?
  
Elvio

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: 16 September 2014 11:07
To: users@camel.apache.org
Subject: Re: Reusable route definitions?

Hi

This sounds fine. You can reuse routes from Java code using the usual Java way with inheritance
or composition.

What some people are doing is have a abstract base route builder class with their common routes
/ error handler etc. And then extend this class and calls super.configure()

On Mon, Sep 15, 2014 at 5:29 PM, toomanyedwards <toomanyedwards@gmail.com> wrote:
> Hey all,
>   I have several "direct:" routes that I'd like to be able to reuse 
> across multiple standalone camel projects.  I am currently using Java 
> DSL to define my routes.  Can anyone point me to any existing patterns 
> for creating reusable route definitions?
>
> The solution I've come up with is creating a "RouteConfigurer" Java 
> interface that has one method: RouteDefinition configure(RouteBuilder)  
> I have specific classes that implement this interface that configure 
> the RouteDefinitions I want to reuse  so that I can use them in 
> different Camel projects.
>
> I feel like I'm probably reinventing the wheel here.  Are there any 
> established patterns/route libraries that already do this better?
>
> -e
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Reusable-route-definitions-tp5756545
> .html Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Mime
View raw message