Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.19.0
-
Novice
Description
I saw in the camel 2.19.0 release notes that xml routes could be reloaded automatically which woke my interest (since we only use xml routes and no java at all). I tried it by specifying the fileWatcherDirectory in my pom.xml (in the camel-maven-plugin configuration) and it worked fine for me. I ran it from within eclipse.
The point is that our camelcontext only holds routeContextRef entries and no real routes. I tried again by specifying the location src/main/resources (where the routecontext files are) but this does not seem to work, no updates are seen.
Claus point me to look in the source code and I saw that ReloadStrategySupport.java holds line 76:
dom = XmlLineNumberParser.parseXml(new ByteArrayInputStream(xml.getBytes()), null, "camelContext,routes", "http://camel.apache.org/schema/spring");
which means that routes from a routeContext are NOT reloaded.
This could be solved by changing the line to:
dom = XmlLineNumberParser.parseXml(new ByteArrayInputStream(xml.getBytes()), null, "camelContext,routes,routeContext", "http://camel.apache.org/schema/spring");
Attachments
Issue Links
- relates to
-
CAMEL-11274 ReloadStrategySupport is not easy extendable because of a number of private's
- Resolved
-
CAMEL-11275 FileWatcherReloadStrategy only watches on specific folder and no sub-folders
- Resolved
- links to