CamelContext.getRouteDefinition() returns null when an exception handler is defined

Solution Verified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content