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


##########
components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java:
##########
@@ -252,15 +532,17 @@ public static RouteDefinition 
templateToRoute(RouteTemplateDefinition in, Map<St
         int line = -1;
         boolean sink = false;
         Collection<ToDefinition> col = filterTypeInOutputs(def.getOutputs(), 
ToDefinition.class);
+
         for (ToDefinition to : col) {
-            if (to.getEndpointUri().startsWith("kamelet:sink") || 
to.getEndpointUri().startsWith("kamelet://sink")) {
+            if (isKameletEndpoint(to.getEndpointUri(), SINK_ID)) {
                 to.setUri("kamelet://sink?" + PARAM_ROUTE_ID + "=" + rid);
                 sink = true;
             }
             line = to.getLineNumber();
         }
+
         if (!sink) {
-            // this is appended and is used to go back to the kamelet that 
called me
+            // This is appended and is used to go back to the Kamelet that 
called me.

Review Comment:
   🔄 **Unrelated cosmetic change:** Comment capitalisation and punctuation 
changed here. Please revert.



##########
components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java:
##########
@@ -214,11 +430,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);

Review Comment:
   🔄 **Unrelated cosmetic change:** The `shouldWrapInErrorHandler` call was 
reformatted from a single line to two lines. Please revert to keep the diff 
focused on the feature.



##########
components/camel-kamelet/src/main/docs/kamelet-component.adoc:
##########
@@ -163,6 +163,52 @@ The usage of this Kamelet into a Camel route is going to 
be the same as any othe
 
 WARNING: beware of any potential circular reference you may introduce when 
using chain of Kamelets, in which case, the runtime will likely be idle 
consuming a high amount of resources.
 
+=== Advanced component endpoint options
+
+Kamelets expose a defined set of parameters, but the underlying Camel 
component may support additional endpoint options. You can pass these options 
when using a Kamelet by prefixing them with `source.` or `sink.`, depending on 
the type of Kamelet.
+
+The prefix is removed when the options are applied to the underlying endpoint 
URI. The options must be supported by the component used by that endpoint.
+
+==== Source Kamelets
+
+For source Kamelets, use the `source.` prefix to pass additional options to 
the underlying source component endpoint.
+
+For example:
+
+[source,java]
+----
+from("kamelet:my-source?source.bridgeErrorHandler=true")
+    .to("log:info");
+----
+
+In this example, `source.bridgeErrorHandler=true` passes 
`bridgeErrorHandler=true` to the source component endpoint. If the endpoint URI 
already contains the same option, the advanced option overrides its existing 
value.
+
+Property placeholders and RAW expressions in endpoint URIs are preserved when 
advanced options are applied. For example, `+kafka:{{topic}}+` or 
`+aws2-s3:{{bucket}}?secretKey=RAW({{secret}})+` remain intact.

Review Comment:
   ⚠️ **Docs CI failure:** AsciiDoc treats `{{topic}}` as `{topic}` (after 
double-brace expansion) and flags it as an undefined attribute, breaking the 
"Validate documentation" CI job. The `+...+` constrained passthrough does not 
suppress attribute substitution for this pattern.
   
   Use `pass:c[...]` instead:
   ```suggestion
   Property placeholders and RAW expressions in endpoint URIs are preserved 
when advanced options are applied. For example, `pass:c[kafka:{{topic}}]` or 
`pass:c[aws2-s3:{{bucket}}?secretKey=RAW({{secret}})]` remain intact.
   ```



##########
components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java:
##########
@@ -214,11 +430,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 change:** `kamelet` → `Kamelet` capitalisation in 
this comment is unrelated to the feature. Please revert.



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