Starting, stopping and removing routes at runtime

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Starting, stopping and removing routes at runtime

da_bus
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.
Reply | Threaded
Open this post in threaded view
|

Re: Starting, stopping and removing routes at runtime

jstrachan
2009/3/6 m.s. <[hidden email]>:

>
> 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/
Reply | Threaded
Open this post in threaded view
|

Re: Starting, stopping and removing routes at runtime

da_bus
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_bus@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/
Reply | Threaded
Open this post in threaded view
|

Re: Starting, stopping and removing routes at runtime

Claus Ibsen-2
On Sun, Mar 15, 2009 at 12:51 PM, m.s. <[hidden email]> 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. <[hidden email]>:
>>>
>>> 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/
Reply | Threaded
Open this post in threaded view
|

Re: Starting, stopping and removing routes at runtime

da_bus
> - 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.
Reply | Threaded
Open this post in threaded view
|

Re: Starting, stopping and removing routes at runtime

Bruno Borges
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. <[hidden email]> 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.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Starting, stopping and removing routes at runtime

da_bus
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
Reply | Threaded
Open this post in threaded view
|

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

Bruno Borges
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" <[hidden email]> 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.