Details
Description
I'm running apache-camel within a apache-karaf container.
Now I recognized the problem, that the route-list command failed, with
the following scenario:
I have route configured where bundle1 reads the data from a file and
forwards the content to a route of bundle 2, using a VmEndpoint.
After startup the route-list command works fine, but as soon as an
incoming message has been processed, the command failed with a
NullPointerException.
I think the problem is located in the DefaultManagementObjectNameStrategy.
Here I can see, the in method getObjectNameForRoute(..)
The camelContext is picked from the Endpoint.
Is there a special reason, why it is not read from the provided route directly?
@Override public ObjectName getObjectNameForRoute(org.apache.camel.Route route) throws MalformedObjectNameException { Endpoint ep = route.getEndpoint(); String id = route.getId(); StringBuilder buffer = new StringBuilder(); buffer.append(domainName).append(":"); buffer.append(KEY_CONTEXT + "=").append(getContextId(ep.getCamelContext())).append(","); buffer.append(KEY_TYPE + "=" + TYPE_ROUTE + ","); buffer.append(KEY_NAME + "=").append(ObjectName.quote(id)); return createObjectName(buffer); }
As in my test-case the context of the endpoint and route differ, this
seems to be the reason, why the JMX-object could not be resolved.
Attachments
Issue Links
- links to