davsclaus opened a new pull request, #27789:
URL: https://github.com/apache/camel/pull/27789

   ## Summary
   
   Fixes [CAMEL-25625](https://issues.apache.org/jira/browse/CAMEL-25625).
   
   For a `to` whose endpoint is a `log` endpoint in throughput mode 
(`groupInterval` or `groupSize`), `DefaultManagementObjectStrategy` registers a 
`ManagedThroughputLogger` instead of a `ManagedSendProcessor`. That MBean had 
no `Destination` attribute. `ProcessorDevConsole.getDestination` picks 
processors by name (`to`, `toD`, `enrich`, ...) and reads the destination 
through a `ManagedDestinationAware` JMX proxy. 
`ManagedCamelContext.getManagedProcessor` does not check that the MBean has the 
requested interface, so the call failed with `AttributeNotFoundException`. 
`/q/dev/processor` (and the `route` console with `processors=true`) then 
returned HTTP 500, without statistics for any processor in the application.
   
   ## Changes
   
   - `ManagedThroughputLoggerMBean` now extends `ManagedDestinationAware`. 
`ManagedThroughputLogger` reports the log endpoint URI as `Destination`, 
sanitized the same way as `ManagedSendProcessor` (follows the management 
agent's `mask` setting). So the consoles show the URI of this `to` like any 
other.
   - `DefaultManagementObjectStrategy` passes the `LogEndpoint` to a new 
`ManagedThroughputLogger` constructor. The existing 3-argument constructor is 
kept (no destination).
   
   This follows the first option proposed in the issue. I did not make the 
console skip MBeans that lack the attribute. With this change every processor 
the console asks for a destination provides one.
   
   ## Tests
   
   - New `ProcessorDevConsoleThroughputLogTest` (camel-console, JMX enabled): 
the route from the report plus a `groupSize` variant. It checks the `uri` of 
each `to` in the `processor` console (JSON and text) and in the `route` console 
with `processors=true`. Against the unfixed camel-management it fails with the 
same `AttributeNotFoundException: ... not found for Destination` as the report.
   - `ManagedLogEndpointTest` also checks the new `Destination` JMX attribute.
   - `mvn install` in `core/camel-management-api`, `core/camel-management` and 
`core/camel-console`: all tests pass.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to