CamelContext.getRouteDefinition() returns null when an exception handler is defined
Issue
A Camel route is defined this this:
from(...).id("foo").something().to(...);
Another part of the application tries to retrieve the Camel route by running
context.getRouteDefinition("foo")...
This works in some cases, but in others getRouteDefinition(name)
returns null, leading to a NullPointerException
. In particular, defining a route-level exception handler causes this to happen (but there are probably other circumstances).
Environment
- Red Hat Fuse
- All versions
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.