camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erkki Lindpere <erkki.lindp...@zeroturnaround.com>
Subject Re: Reloading Camel routes with JRebel
Date Fri, 16 Nov 2012 15:09:13 GMT
Thanks, Christian and Claus, this helped -- I didn't realize before that I
should do the stopping in a separate thread. This works with some examples
I'm trying.

Do you know if this approach should work when I have to stop multiple
routes? Because I think I need to stop every route created by one
RouteBuilder before I let it recreate them.

For example, if I start the thread to stop all 3 routes in the
camel-example-cxf-tomcat while a message in the 1st route is being
processed, the processing will fail -- with various exceptions depending on
timing, one case being that there is no consumer for the "direct:..."
endpoint where the message is sent from route 1 (and where route 2 or route
3 should consume it).

I'm not sure what a good solution is in such a case, or in the general case
where the routes may be even more complex.

Erkki

On Fri, Nov 16, 2012 at 9:43 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> On Thu, Nov 15, 2012 at 2:11 PM, Erkki Lindpere
> <erkki.lindpere@zeroturnaround.com> wrote:
> > Hi,
> >
> > I'm from ZeroTurnaround and started working on a JRebel Camel plug-in.
> The
> > current plan is to update routes whenever a RouteBuilder class changes.
> > Feel free to suggest other things that a JRebel-Camel plug-in should do.
> >
>
> Ah this sounds very cool.
>
> > I have a basic prototype working, and what I do is
> removeRouteDefinitions,
> > then rerun the RouteBuilder to add the changed ones back.
> >
> > A problem I have is when to trigger a reload. If I trigger it once a
> > message comes in (JRebel usually does things lazily), the reloading of
> the
> > route causes the message in progress to fail.
> >
>
> If you remove the route first using that API call ^^^, then Camel will
> stop the routes first in a graceful manner.
> http://camel.apache.org/graceful-shutdown.html
>
> > Is there any way to safely find a point where a route can be updated?
> >
>
> So after this call, then there ought not to be any inflight messages.
> And a safe point to reload a new RouteBuilder with routes.
>
>
> > Regards
> > Erkki Lindpere
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message