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

   Fixes the remaining items of CAMEL-25072 (item 2, the component verifier 
code, is in #27071).
   
   1. **listEndpointServices key clash**: the tabular data was keyed by 
component, dir, serviceUrl and endpointUri, so two routes consuming from the 
same service endpoint failed with `KeyAlreadyExistsException`. The key now 
includes `routeId`, and a row whose key is already present (endpoints of one 
route that only differ in a masked secret) is skipped, as `listEndpoints` does 
since CAMEL-25064. Also in `DefaultEndpointServiceRegistry`: with the runtime 
endpoint registry enabled, every consumer took the hits and route id of the 
first statistic for the uri, so both routes showed the same route id. The 
statistic of the consumer's own route is used now.
   2. **Min/max processing time race**: `StatisticMinimum`/`StatisticMaximum` 
did a read then an unconditional set, so a concurrent update could overwrite a 
smaller/larger value. They now use a compare-and-set loop. It doesn't allocate 
(the reason `updateAndGet` was avoided), and the common case where nothing 
changes is still a single read.
   3. **Notification types of the event notifier MBean**: `getNotificationInfo` 
advertised types like 
`org.apache.camel.management.event.CamelContextStartedEvent` (and missed 
several events, with a typo `ExchangeRedeliveryEvents`), while 
`JmxNotificationEventNotifier` sends the simple class name of the event. The 
advertised types are now built from `CamelEvent.Type` and match what's sent, 
with `javax.management.Notification` as the notification class.
   
   Both tabular key and notification info changes are documented in the 4.23 
upgrade guide.
   
   Tests that fail without the fixes: `ManagedEndpointServiceRegistryTest` (+ 
`...RuntimeTest` with the runtime endpoint registry), 
`StatisticMinimumMaximumTest#testConcurrentUpdates` (a lost update reproduced 
locally without the fix, but a race test can't fail every time), 
`JmxNotificationEventNotifierTest#testExchangeDone`. The full camel-management 
test suite passes (517 tests; `ManagedRouteStopWithAbortAfterTimeoutTest` 
flaked once on timing and passed on rerun).
   
   _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