gnodet-bot commented on code in PR #27686:
URL: https://github.com/apache/camel/pull/27686#discussion_r4255797947


##########
components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java:
##########
@@ -214,11 +437,12 @@ public static RouteDefinition 
templateToRoute(RouteTemplateDefinition in, Map<St
             // (if ppid is null then it is a source kamelet)
             if (ppid != null) {
                 ProcessorDefinition<?> pro = mcc.getProcessorDefinition(ppid);
-                wrap = pro == null || 
ProcessorDefinitionHelper.shouldWrapInErrorHandler(mcc, pro, null,
-                        CamelContextHelper.parseBoolean(mcc, 
pro.getInheritErrorHandler()));
+                wrap = pro == null || 
ProcessorDefinitionHelper.shouldWrapInErrorHandler(
+                        mcc, pro, null, CamelContextHelper.parseBoolean(mcc, 
pro.getInheritErrorHandler()));

Review Comment:
   🔄 **Unrelated cosmetic (re-raise, PRRT_kwDOAAMl7c6ruRBr not addressed):** 
This `shouldWrapInErrorHandler` call was reformatted from a single line to two 
lines. It is in the pre-existing `templateToRoute` code and unrelated to the 
advanced-options feature. Please revert:
   ```suggestion
                   wrap = pro == null || 
ProcessorDefinitionHelper.shouldWrapInErrorHandler(mcc, pro, null, 
CamelContextHelper.parseBoolean(mcc, pro.getInheritErrorHandler()));
   ```



##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -202,3 +202,9 @@ throttling): the failure of the first object is then the 
failure of the poll, an
 In both cases the objects are no longer kept in the `inProgressRepository`; 
before, the object (or a new object with
 the same key) was skipped by all later polls until the endpoint was restarted. 
With the `fileName` option, a failed
 get still fails the poll.
+
+=== camel-kamelet - support advanced component and endpoint options
+
+Kamelets can now support advanced component and endpoint options when creating 
the underlying component and endpoint. This allows Kamelets to expose and use 
options beyond the standard options previously handled by the Kamelet 
component, including options that require special handling of endpoint URI 
parameters.
+
+Existing Kamelets that use these advanced options can now pass them through to 
the underlying component or endpoint. Review custom Kamelets that define or 
forward endpoint options to ensure that the options are intended for the 
underlying component or endpoint and that they do not conflict with 
Kamelet-specific options.

Review Comment:
   ⚠️ **Missing breaking-change warning:** The `source.*` and `sink.*` URI 
parameter prefixes are now reserved by the Kamelet component. A user who 
previously used a Kamelet template parameter named `source.retries` or 
`sink.timeout` and passed it as a URI query param (e.g. 
`kamelet:my-kamelet?source.retries=3`) will silently have it intercepted and 
forwarded to the underlying endpoint, bypassing the Kamelet template entirely.
   
   The current text is too vague to let affected users identify themselves. Add 
a concrete warning:
   
   ```suggestion
   === camel-kamelet - support advanced component and endpoint options
   
   Kamelets can now pass additional options directly to the underlying 
component endpoint using the `source.*` prefix for source Kamelets and the 
`sink.*` prefix for sink and action Kamelets.
   
   **Breaking change:** The `source.` and `sink.` prefixes in Kamelet URI 
parameters are now reserved. Any Kamelet template property previously named 
with a `source.` or `sink.` prefix passed as a URI query parameter (e.g. 
`kamelet:my-kamelet?source.retries=3`) will now be intercepted and forwarded to 
the underlying endpoint instead of the Kamelet template. Rename such properties 
to avoid conflicts.
   
   When no advanced options are supplied (no `source.` or `sink.` prefix is 
present in the URI parameters), existing Kamelets retain their current behavior.
   ```



##########
components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java:
##########
@@ -214,11 +437,12 @@ public static RouteDefinition 
templateToRoute(RouteTemplateDefinition in, Map<St
             // (if ppid is null then it is a source kamelet)
             if (ppid != null) {
                 ProcessorDefinition<?> pro = mcc.getProcessorDefinition(ppid);
-                wrap = pro == null || 
ProcessorDefinitionHelper.shouldWrapInErrorHandler(mcc, pro, null,
-                        CamelContextHelper.parseBoolean(mcc, 
pro.getInheritErrorHandler()));
+                wrap = pro == null || 
ProcessorDefinitionHelper.shouldWrapInErrorHandler(
+                        mcc, pro, null, CamelContextHelper.parseBoolean(mcc, 
pro.getInheritErrorHandler()));
             }
+
             if (wrap && parent != null && parent.isKamelet() == null) {
-                // do not wrap if the parent is also a kamelet
+                // do not wrap if the parent is also a Kamelet

Review Comment:
   🔄 **Unrelated cosmetic (re-raise, PRRT_kwDOAAMl7c6ruRBv / 
PRRT_kwDOAAMl7c6ruRBz not addressed):** `kamelet` → `Kamelet` capitalisation in 
this comment is unrelated to the feature. Please revert:
   ```suggestion
                   // do not wrap if the parent is also a kamelet
   ```



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