I am attempting to load an Apache Camel route at runtime from a file. This means
My "route.yaml" file is as follows.
- route:
from: "timer:yaml?period=3s"
steps:
- set-body:
simple: "Timer fired ${header.CamelTimerCounter} times"
- to:
uri: "log:yaml"
I have seen that in the past it was possible to do the following to load a route xml file, but now this cannot be done. For example I see loadRoutesDefinition at Unable to start Camel Routes which are loaded from external XML
InputStream routesXml = new ByteArrayInputStream(routePropertyValue.toString().getBytes());
RoutesDefinition loadedRoutes = camelContext.loadRoutesDefinition(routesXml);
camelContext.addRouteDefinitions(loadedRoutes.getRoutes());
How to do it with the current Apache Camel?