davsclaus commented on code in PR #27464:
URL: https://github.com/apache/camel/pull/27464#discussion_r4203983007


##########
core/camel-management/src/main/java/org/apache/camel/management/InstrumentationInterceptStrategy.java:
##########
@@ -33,13 +33,26 @@
  */
 public class InstrumentationInterceptStrategy implements 
ManagementInterceptStrategy {
 
+    /**
+     * A processor that has been wrapped for performance counters.
+     *
+     * @param definition               the definition the processor was 
created from, which can be shared by several
+     *                                 routes (such as the outputs of a 
context scoped onException)
+     * @param instrumentationProcessor the processor that wraps it
+     * @param route                    the route the processor belongs to
+     */
+    public record WrappedProcessor(NamedNode definition, 
InstrumentationProcessor<?> instrumentationProcessor, Route route) {
+    }
+
     private final Map<NamedNode, PerformanceCounter> registeredCounters;
-    private final Map<Processor, KeyValueHolder<NamedNode, 
InstrumentationProcessor<?>>> wrappedProcessors;
+    private final Map<Processor, WrappedProcessor> wrappedProcessors;
+    private final Route route;
 
     public InstrumentationInterceptStrategy(Map<NamedNode, PerformanceCounter> 
registeredCounters,

Review Comment:
   `InstrumentationInterceptStrategy` is a public class, and this changes its 
constructor (the map value type and the new `Route` parameter). It is only used 
by `JmxManagementLifecycleStrategy` in this repo, so it is internal in 
practice, but could you add a one-line note to the 4.23 upgrade guide 
(camel-management section)? Also, `route` must not be null, otherwise 
`holder.route().getId()` throws an NPE; an `ObjectHelper.notNull` check would 
make that explicit.



-- 
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