0

Suppose I have 10 different Camel routes in my application, is it possible to stop one particular route alone during an issue and make changes to it(in one of the java processors) and deploy it again without affecting other routes.

Also can I create and deploy a new route on the fly, while other routes are already functioning.

If these are not the default behaviour, what are the options available to achieve this?

2 Answers2

1

Karaf (so do Apache ServiceMix / JBoss Fuse)has hot deployment (nowadays this might be supported in JBoss AS / WildFly as well ). Meaning, you can create your routes as independent blueprint xml files in the deploy folder (meaning just xmls). Likewise you can have xml files for every route, whenever you make changes to XML's, it will be redeployed automatically.

This approach has few drawbacks, it will be complex if you have to deal with JPA or if your route has to deal with custom processors / classes.

Check out the examples in Apache ServiceMix / JBoss Fuse project.

I would recommend this approach especially if you want to take a microcontainer approach - Something like light weight Apache Karaf + Camel Route XML files + Docker.

I have done this few years back, may be this feature is possible to achieve in any other containers as well, which I am not sure.

gnanagurus
  • 883
  • 1
  • 12
  • 29
  • 1
    Thank you so much for the reply @gnanagurus . As you said dealing with custom processors/classes would be complex - is it not possible? or can be achieved with a few more complicated steps? – Chidambaram Palaniappan Jul 25 '16 at 01:36
0

You can stop a route via org.apache.camel.CamelContext.stopRoute(id) & you can modify it by building a new route and adding it to the context. This would let you change the logic of a route at runtime.

This wouldn't automatically let you hot deploy a new Java processor. I think this aspect of your question isn't Camel specific - their seem to be a few options for this, including OSGi/Karaf mentioned by @gnanaguru.

Perhaps moving the logic that you think might change from a Java processor to somewhere more dynamic (like some JavaScript in an external file, or in the route itself) would be a simpler solution to your problem.

Paul M
  • 357
  • 1
  • 8