You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gnanaguru S <gn...@wipro.com> on 2013/09/24 07:15:42 UTC

Duplicate Camel routes

Hi, 

Is there any way we can avoid creating Camel routes with Camel Route ID ?

If I create two similar routes with same route ID, both routes are active. 

Is there any way in Camel where I can control creating duplicate routes with
same route id ?

Thanks
Guru
gnanaguru.com






--
View this message in context: http://camel.465427.n5.nabble.com/Duplicate-Camel-routes-tp5740090.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Duplicate Camel routes

Posted by Claus Ibsen <cl...@gmail.com>.
To add routes you can use the API on CamelContext as you do, eg addRoutes.

You should just reuse the same CamelContext instance so the routes is
running in the same camel container.

On Tue, Sep 24, 2013 at 9:40 AM, Gnanaguru S
<gn...@wipro.com> wrote:
>
> Am sorry, Its my mistake. I am creating new camel context's every time,
> instead of adding routes to the existing Camel context.
>
> I am creating new default camel context every time:
>
> CamelContext context = new DefaultCamelContext();
> context.addRoutes(new FTPRouteBuilder(context, channelId, fromUri, toUri));
>
> Any advice for me to add routes to the existing context ? I am able to see
> some documentation on loading routes from XML file but not using API's.
>
> Thanks
> Guru
> gnanaguru.com
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Duplicate-Camel-routes-tp5740090p5740101.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

Re: Duplicate Camel routes

Posted by Gnanaguru S <gn...@wipro.com>.
Am sorry, Its my mistake. I am creating new camel context's every time,
instead of adding routes to the existing Camel context. 

I am creating new default camel context every time:

CamelContext context = new DefaultCamelContext();
context.addRoutes(new FTPRouteBuilder(context, channelId, fromUri, toUri));

Any advice for me to add routes to the existing context ? I am able to see
some documentation on loading routes from XML file but not using API's. 

Thanks
Guru
gnanaguru.com



--
View this message in context: http://camel.465427.n5.nabble.com/Duplicate-Camel-routes-tp5740090p5740101.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Duplicate Camel routes

Posted by Claus Ibsen <cl...@gmail.com>.
If the routes are in the same <camelContext> then Camel should detect
duplicate route ids and fail starting the routes.

What Camel version do you use?

On Tue, Sep 24, 2013 at 9:00 AM, Gnanaguru S
<gn...@wipro.com> wrote:
> Hi Charles,
>
> While registering a new route, Is there any way in camel I can check whether
> the same routeid exist already ?
>
> Or I need to store the routeid in DB/XML for this validation ?
>
> I was searching that if Camel has any flag which will avoid creating routeid
> which exist already :)
>
> Thanks
> Guru
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Duplicate-Camel-routes-tp5740090p5740098.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

Re: Duplicate Camel routes

Posted by Gnanaguru S <gn...@wipro.com>.
Hi Charles, 

While registering a new route, Is there any way in camel I can check whether
the same routeid exist already ? 

Or I need to store the routeid in DB/XML for this validation ?

I was searching that if Camel has any flag which will avoid creating routeid
which exist already :)

Thanks
Guru



--
View this message in context: http://camel.465427.n5.nabble.com/Duplicate-Camel-routes-tp5740090p5740098.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Duplicate Camel routes

Posted by Charles Moulliard <ch...@gmail.com>.
What do you by control 'creating duplicate routes' ? Generate warning/error
message when CamelContext registering the camel routes will start ....


On Tue, Sep 24, 2013 at 7:15 AM, Gnanaguru S <
gnanaguru.sattanathan@wipro.com> wrote:

> Hi,
>
> Is there any way we can avoid creating Camel routes with Camel Route ID ?
>
> If I create two similar routes with same route ID, both routes are active.
>
> Is there any way in Camel where I can control creating duplicate routes
> with
> same route id ?
>
> Thanks
> Guru
> gnanaguru.com
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Duplicate-Camel-routes-tp5740090.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com