camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elvio Caruana (ecaruana)" <>
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?

-----Original Message-----
From: Claus Ibsen [] 
Sent: 16 September 2014 11:07
Subject: Re: Reusable route definitions?


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 <> 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: 
> .html Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:
View raw message