Hi Jorg Yeah that is a good question. At first route templates is designed to be simple from the beginning.
Can you try with errorHandler(new ErrorHandlerBuilderRef("{{my-error-handler-ref}}")); On Mon, Feb 1, 2021 at 11:48 AM Jörg Jansen <jansen...@gmail.com> wrote: > > Hi Claus, > > thanks for your response. > I agree, just to use String literals. > > But maybe you can tell me what's the best way to add a route-specific > errorhandler? > > I solved my issue by doing it the following way: > > ModelCamelContext modelCamelContext = > camelContext.adapt(ModelCamelContext.class); > RouteDefinition routeDefinition = > modelCamelContext.getRouteDefinition("my-templated-route-id"); > if (routeDefinition != null) > routeDefinition.setErrorHandlerRef("my-error-handler-ref"); > > This seems to me, quite complicate, so maybe there is a better way to > do, which I'm not aware of? > > Or maybe it would be a good improvement (handle this like the routeId) > for an upcoming release? > > Kind regards, > Jörg -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2