Worked like a charm with yaml, thanks again Raymond. If anyone out there knows whether "PluginHelper" is the intended approach or if there is a preferred alternative, it would be helpful to know. I'm also wondering if there is any documentation on how the camel context has been extended. Neither Gemini nor ChatGPT mentioned PluginHelper and both sent me on what were, for me, wild goose chases.
>From PluginHelper at GitHub: public static RoutesLoader getRoutesLoader(CamelContext camelContext) { return getRoutesLoader(camelContext.getCamelContextExtension()); } On Wed, Apr 9, 2025 at 9:30 AM Mitch Trachtenberg <mjt...@gmail.com> wrote: > Thanks! I'll see if that works with the obvious change(s). > > On Wed, Apr 9, 2025 at 1:33 AM ski n <raymondmees...@gmail.com> wrote: > >> I don't know about Yaml, but this is how I load XML routes as String like >> this: >> >> loader = PluginHelper.getRoutesLoader(context); >> >> loader.loadRoutes(setResource(route,"xml")); >> >> private Resource setResource(String route, String type){ >> >> String uuid = UUID.randomUUID().toString(); >> >> if(type.equals("xml")){ >> return ResourceHelper.fromString("route_" + uuid + ".xml", route); >> }else if(type.equals("yaml")){ >> return ResourceHelper.fromString("route_" + uuid + ".yaml", route); >> }else{ >> log.warn("unknown route format"); >> } >> >> } >> >> Hope this helps. >> >> Raymond >> >> On Wed, Apr 9, 2025 at 1:30 AM Mitch Trachtenberg <mjt...@gmail.com> >> wrote: >> >> > Hi, >> > >> > I see there is a function YamlRoutesBuilderLoader, which returns a >> routes >> > loader. It returns a RouteBuilder (?). I also see a build method, but >> > that wants a yaml deserialization context (?). >> > >> > Is there any straightforward example of how to use the RouteBuilder >> > returned by YamlRoutesBuilderLoader to load a route specified in a >> String >> > or InputStream, in the 4.10.x series? I've tried about ten variants >> > proposed by AIs that think they know more than they do, and it seems >> like >> > there must be a method somewhere like loadYamlRouteFromStream. >> > >> > Thanks for any light that you can shed. >> > >> > Mitch >> > >> >