You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "m.s." <da...@arcor.de> on 2009/03/06 12:56:39 UTC

Starting, stopping and removing routes at runtime

There are some older post on this topic in the forum, but I could not figure
out if the answers are still up to date. So is it possible to remove routes
from the CamelContext to add updated ones at runtime? And what happens with
messages on a route that are not delivered when the route stops or is
removed?

I'm currently evaluating Camel 1.6 and the 2.0 Snapshot to figure out if it
works in my application, so any information about this would be very helpful
for me.

M.S.
-- 
View this message in context: http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22370230.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Re: Starting, stopping and removing routes at runtime

Posted by br...@gmail.com.
I see your point. But consider using ServiceMix, it is lightweight and has  
all you need for your case.

Adding this features to Camel will turn it into a competitor against real  
ESBs in my opinion. And also, will make it bigger and  
not-anymore-just-a-library-framework-like for those who need only core  
features like ... routing.

m2c

On Mar 20, 2009 8:16am, "ms" <da...@arcor.de> wrote:


> I'm too new to the Camel and ESB world to give a definitive answer to  
> this,

> but I think those route managing capabilities are useful if Camel is  
> running

> as a standalone application.



> In my case, I don't need the integration and JBI capabilities of  
> ServiceMix

> but only an easy way to define messaging routes. And as there are  
> components

> in the application that are added or removed at runtime, I need to start  
> or

> stop the corresponding routes at runtime as well. So I think it's good  
> that

> there are methods in the Camel 2.0 API to this.



> MS







> Bruno Borges wrote:

> >

> > I'm sorry I'm getting this thread in the middle without reading previous

> > messages, but just one thought: isn't this what ESBs are supposed to

> > manage?

> >

> > I mean, with ESBs we can plug'n play routes easily, add, remove,  
> whatever.

> > If Camel start to have functions like this, wouldn't be overlapping with

> > ESBs functions?

> >

> > How would Camel compare with ServiceMix for example?

> >

> > Please don't shoot. :-)

> >

> > Best regards,

> > Bruno Borges

> > blog.brunoborges.com.br

> > +55 21 76727099

> >



> --

> View this message in context:  
> http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22618396.html

> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.




Re: Starting, stopping and removing routes at runtime

Posted by "m.s." <da...@arcor.de>.
I'm too new to the Camel and ESB world to give a definitive answer to this,
but I think those route managing capabilities are useful if Camel is running
as a standalone application.

In my case, I don't need the integration and JBI capabilities of ServiceMix
but only an easy way to define messaging routes. And as there are components
in the application that are added or removed at runtime, I need to start or
stop the corresponding routes at runtime as well. So I think it's good that
there are methods in the Camel 2.0 API to this.

M.S.



Bruno Borges wrote:
> 
> I'm sorry I'm getting this thread in the middle without reading previous
> messages, but just one thought: isn't this what ESBs are supposed to
> manage?
> 
> I mean, with ESBs we can plug'n play routes easily, add, remove, whatever.
> If Camel start to have functions like this, wouldn't be overlapping with
> ESBs functions?
> 
> How would Camel compare with ServiceMix for example?
> 
> Please don't shoot. :-)
> 
> Best regards,
> Bruno Borges
> blog.brunoborges.com.br
> +55 21 76727099
> 

-- 
View this message in context: http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22618396.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Starting, stopping and removing routes at runtime

Posted by Bruno Borges <br...@gmail.com>.
I'm sorry I'm getting this thread in the middle without reading previous
messages, but just one thought: isn't this what ESBs are supposed to manage?

I mean, with ESBs we can plug'n play routes easily, add, remove, whatever.
If Camel start to have functions like this, wouldn't be overlapping with
ESBs functions?

How would Camel compare with ServiceMix for example?

Please don't shoot. :-)

Best regards,
Bruno Borges
blog.brunoborges.com.br
+55 21 76727099

"The glory of great men should always be
measured by the means they have used to
acquire it."
- Francois de La Rochefoucauld


On Wed, Mar 18, 2009 at 10:15 AM, m.s. <da...@arcor.de> wrote:

>
>
>
> >> - can I get a single RouteDefinition, or only a list that I must iterate
> >> to
> >> find the one I am looking for?
> > The API is what we got. But we are open for API changes in Camel 2.0
> > so if you have suggestions what
> > you would like changed/added that feedback is much appreciated.
> >
>
> I think a pre check if a route with a certain ID already exists would be
> helpful. I would also like to do more things based on the routeID, instead
> of getting the list with the RouteDefinitions and then searching for the
> one
> I want to manipulate. I am thinking about methods like
> - RouteDefinition getRouteDefinition(String id)
> - void startRoute(String id)
> - void stopRoute(String id)
> - boolean routeExists(String id)
>
> On the other hand I am not sure if this is really feasible as the route ID
> is an optional attribute. And as these route manipulations at runtime do
> not
> occur that often, the current API and some additional code in the
> application is probably sufficient in most cases.
>
> M.S.
> --
> View this message in context:
> http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22578949.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>

Re: Starting, stopping and removing routes at runtime

Posted by "m.s." <da...@arcor.de>.


>> - can I get a single RouteDefinition, or only a list that I must iterate
>> to
>> find the one I am looking for?
> The API is what we got. But we are open for API changes in Camel 2.0
> so if you have suggestions what
> you would like changed/added that feedback is much appreciated.
> 

I think a pre check if a route with a certain ID already exists would be
helpful. I would also like to do more things based on the routeID, instead
of getting the list with the RouteDefinitions and then searching for the one
I want to manipulate. I am thinking about methods like
- RouteDefinition getRouteDefinition(String id)
- void startRoute(String id)
- void stopRoute(String id)
- boolean routeExists(String id)

On the other hand I am not sure if this is really feasible as the route ID
is an optional attribute. And as these route manipulations at runtime do not
occur that often, the current API and some additional code in the
application is probably sufficient in most cases.

M.S.
-- 
View this message in context: http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22578949.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Starting, stopping and removing routes at runtime

Posted by Claus Ibsen <cl...@gmail.com>.
On Sun, Mar 15, 2009 at 12:51 PM, m.s. <da...@arcor.de> wrote:
>
> Thanks, that's exactly what I was looking for. But after looking at the
> JavaDocs and writing a simple test application, there are still some points
> I do not understand, maybe you can help me to clarify them:
>
> - is there a way to avoid duplicated routes? (I tried to set an unique ID,
> but I could add two routes with the same ID when I added a RouteBuilder
> twice)
I dont think there is a pre check for that. But we could add it if its feasible.
James you thought?


> - can I get a single RouteDefinition, or only a list that I must iterate to
> find the one I am looking for?
The API is what we got. But we are open for API changes in Camel 2.0
so if you have suggestions what
you would like changed/added that feedback is much appreciated.


> - was the RouteType (in the JavaDoc on the Camel homepage) just renamed to
> RouteDefinition, or are they different concepts?
Yes there was a rename.

>
> Cheers,
> M.S.
>
>
> James.Strachan wrote:
>>
>> 2009/3/6 m.s. <da...@arcor.de>:
>>>
>>> There are some older post on this topic in the forum, but I could not
>>> figure
>>> out if the answers are still up to date. So is it possible to remove
>>> routes
>>> from the CamelContext to add updated ones at runtime? And what happens
>>> with
>>> messages on a route that are not delivered when the route stops or is
>>> removed?
>>>
>>> I'm currently evaluating Camel 1.6 and the 2.0 Snapshot to figure out if
>>> it
>>> works in my application, so any information about this would be very
>>> helpful
>>> for me.
>>
>> You can now stop and start routes in 2.0 SNAPSHOT - details in this
>> thread and JIRA...
>>
>> http://www.nabble.com/starting%2C-stopping%2C-creating---editing-routes-at-runtime-now-works----CAMEL-1004-td22208810s22882.html#a22218251
>>
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22522393.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

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

Re: Starting, stopping and removing routes at runtime

Posted by "m.s." <da...@arcor.de>.
Thanks, that's exactly what I was looking for. But after looking at the
JavaDocs and writing a simple test application, there are still some points
I do not understand, maybe you can help me to clarify them:

- is there a way to avoid duplicated routes? (I tried to set an unique ID,
but I could add two routes with the same ID when I added a RouteBuilder
twice)
- can I get a single RouteDefinition, or only a list that I must iterate to
find the one I am looking for?
- was the RouteType (in the JavaDoc on the Camel homepage) just renamed to
RouteDefinition, or are they different concepts?

Cheers,
M.S.


James.Strachan wrote:
> 
> 2009/3/6 m.s. <da...@arcor.de>:
>>
>> There are some older post on this topic in the forum, but I could not
>> figure
>> out if the answers are still up to date. So is it possible to remove
>> routes
>> from the CamelContext to add updated ones at runtime? And what happens
>> with
>> messages on a route that are not delivered when the route stops or is
>> removed?
>>
>> I'm currently evaluating Camel 1.6 and the 2.0 Snapshot to figure out if
>> it
>> works in my application, so any information about this would be very
>> helpful
>> for me.
> 
> You can now stop and start routes in 2.0 SNAPSHOT - details in this
> thread and JIRA...
> 
> http://www.nabble.com/starting%2C-stopping%2C-creating---editing-routes-at-runtime-now-works----CAMEL-1004-td22208810s22882.html#a22218251
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Starting%2C-stopping-and-removing-routes-at-runtime-tp22370230p22522393.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Starting, stopping and removing routes at runtime

Posted by James Strachan <ja...@gmail.com>.
2009/3/6 m.s. <da...@arcor.de>:
>
> There are some older post on this topic in the forum, but I could not figure
> out if the answers are still up to date. So is it possible to remove routes
> from the CamelContext to add updated ones at runtime? And what happens with
> messages on a route that are not delivered when the route stops or is
> removed?
>
> I'm currently evaluating Camel 1.6 and the 2.0 Snapshot to figure out if it
> works in my application, so any information about this would be very helpful
> for me.

You can now stop and start routes in 2.0 SNAPSHOT - details in this
thread and JIRA...

http://www.nabble.com/starting%2C-stopping%2C-creating---editing-routes-at-runtime-now-works----CAMEL-1004-td22208810s22882.html#a22218251


-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/