Claus Ibsen created CAMEL-25065:
-----------------------------------

             Summary: camel-management - Processor statistics freeze after a 
route restart, and ContextOnly context statistics stay 0
                 Key: CAMEL-25065
                 URL: https://issues.apache.org/jira/browse/CAMEL-25065
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen


A deep review of how camel-management registers MBeans 
(JmxManagementLifecycleStrategy) found the bugs below. Each one was reproduced 
against 4.23.0-SNAPSHOT and has a test that fails without the fix.

# *The statistics of a processor MBean stop updating after its route is stopped 
and started.* Since 4.14 (CAMEL-22312) stopping a route keeps its processor 
MBeans. When the route is started again, a new managed object was created for 
each processor and set as the counter of its instrumentation, but it was not 
registered (the MBean already was), so the exchanges were counted on an object 
that nobody can see and the registered MBean kept its old numbers (also in 
dumpRouteStatsAsXml, camel get processor and the TUI). The managed object of a 
processor is now reused when its route is started again.
# *With mbeansLevel=ContextOnly the statistics of the CamelContext MBean stay 
at 0.* The exchanges of a route were only counted on the CamelContext MBean 
through the route MBean, which is not registered with ContextOnly (or for 
routes left out by registerNewRoutes / registerRoutesCreateByTemplate). Such 
routes are now counted on the CamelContext MBean.

*Not changed (for a later look)*
* A CamelContext name (or management name pattern) with , = : " * or ? fails to 
start, as the context key of the object names is not quoted (every query that 
builds the context key would have to be changed too).
* A context-scoped onException is one definition in every route, so its 
processors share one MBean, which is unregistered when one of the routes is 
removed.
* Two endpoints that only differ in a masked secret have the same object name; 
removing one unregisters the MBean of the other.
* Thread pools created by the same source (such as the aggregate's recover and 
timeout checkers) have the same object name.
* Components are registered with mbeansLevel=ContextOnly.

_Claude Code on behalf of Claus Ibsen_




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to