You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/02/25 18:06:52 UTC

(camel) branch main updated (a58804f5c116 -> 65746971ab65)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from a58804f5c116 CAMEL-23074 - camel-langchain4j-tools: Add tool parameter metadata support (required, enum)
     new c6c0b1ba6cb2 CAMEL-16861: Update docs
     new a897a114d7f4 CAMEL-16861: Update docs
     new 6da43f2a5900 camel-jbang - transform route should be able to disregard boolean properties function
     new 65746971ab65 CAMEL-16861: Update docs

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../DefaultPropertiesFunctionResolver.java         |  15 +-
 .../component/properties/PropertiesComponent.java  |   6 -
 .../pages/using-exchange-pattern-annotations.adoc  |  62 +-
 .../ROOT/pages/using-propertyplaceholder.adoc      | 813 ++++++++++++++++++---
 .../modules/ROOT/pages/uuidgenerator.adoc          |  52 +-
 docs/user-manual/modules/ROOT/pages/validator.adoc |  56 +-
 .../java/org/apache/camel/main/KameletMain.java    |   9 +-
 ...ndencyDownloaderPropertiesFunctionResolver.java |  26 +-
 8 files changed, 836 insertions(+), 203 deletions(-)


(camel) 03/04: camel-jbang - transform route should be able to disregard boolean properties function

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6da43f2a5900c1a4611f830a2f90a76209e3567c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Feb 25 17:08:56 2026 +0100

    camel-jbang - transform route should be able to disregard boolean properties function
---
 .../DefaultPropertiesFunctionResolver.java         | 15 +++++++------
 .../component/properties/PropertiesComponent.java  |  6 -----
 .../java/org/apache/camel/main/KameletMain.java    |  9 ++++----
 ...ndencyDownloaderPropertiesFunctionResolver.java | 26 +++++++++++++++++++++-
 4 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesFunctionResolver.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesFunctionResolver.java
index a88f42816b02..f5951dafffc5 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesFunctionResolver.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesFunctionResolver.java
@@ -43,13 +43,6 @@ public class DefaultPropertiesFunctionResolver extends ServiceSupport
     private final Map<String, PropertiesFunction> functions = new LinkedHashMap<>();
 
     public DefaultPropertiesFunctionResolver() {
-        // include out of the box functions
-        addPropertiesFunction(new EnvPropertiesFunction());
-        addPropertiesFunction(new SysPropertiesFunction());
-        addPropertiesFunction(new ServicePropertiesFunction());
-        addPropertiesFunction(new ServiceHostPropertiesFunction());
-        addPropertiesFunction(new ServicePortPropertiesFunction());
-        addPropertiesFunction(new BooleanPropertiesFunction());
     }
 
     @Override
@@ -124,6 +117,14 @@ public class DefaultPropertiesFunctionResolver extends ServiceSupport
 
     @Override
     protected void doInit() throws Exception {
+        // include out of the box functions
+        addPropertiesFunction(new EnvPropertiesFunction());
+        addPropertiesFunction(new SysPropertiesFunction());
+        addPropertiesFunction(new ServicePropertiesFunction());
+        addPropertiesFunction(new ServiceHostPropertiesFunction());
+        addPropertiesFunction(new ServicePortPropertiesFunction());
+        addPropertiesFunction(new BooleanPropertiesFunction());
+
         functions.values().forEach(f -> CamelContextAware.trySetCamelContext(f, camelContext));
         ServiceHelper.initService(functions.values());
     }
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
index 9215e4125475..9957c589a9a3 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
@@ -131,12 +131,6 @@ public class PropertiesComponent extends ServiceSupport
 
     public PropertiesComponent() {
         addPropertiesLookupListener(defaultPropertiesLookupListener);
-        // include out of the box functions
-        addPropertiesFunction(new EnvPropertiesFunction());
-        addPropertiesFunction(new SysPropertiesFunction());
-        addPropertiesFunction(new ServicePropertiesFunction());
-        addPropertiesFunction(new ServiceHostPropertiesFunction());
-        addPropertiesFunction(new ServicePortPropertiesFunction());
     }
 
     /**
diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java
index 6d949b81481a..91ace180b2b7 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java
@@ -440,11 +440,13 @@ public class KameletMain extends MainCommandLineSupport {
         answer.getCamelContextExtension().setStartupStepRecorder(new BacklogStartupStepRecorder());
 
         boolean export = "true".equals(getInitialProperties().get(getInstanceType() + ".export"));
+        boolean transform = "true".equals(getInitialProperties().get(getInstanceType() + ".transform"));
         if (export) {
-            setupExport(answer, export);
+            // both when exporting and transforming routes then we need to setup in special mode
+            setupExport(answer, true);
         } else {
             PropertiesComponent pc = (PropertiesComponent) answer.getPropertiesComponent();
-            pc.setPropertiesFunctionResolver(new DependencyDownloaderPropertiesFunctionResolver(answer, false));
+            pc.setPropertiesFunctionResolver(new DependencyDownloaderPropertiesFunctionResolver(answer, false, transform));
         }
 
         // groovy scripts
@@ -482,7 +484,6 @@ public class KameletMain extends MainCommandLineSupport {
         SagaDownloader.registerDownloadReifiers(this);
 
         // if transforming DSL then disable processors as we just want to work on the model (not runtime processors)
-        boolean transform = "true".equals(getInitialProperties().get(getInstanceType() + ".transform"));
         if (transform) {
             // we just want to transform, so disable custom bean or processors as they may use code that does not work
             answer.getGlobalOptions().put(ProcessorReifier.DISABLE_BEAN_OR_PROCESS_PROCESSORS, "true");
@@ -781,7 +782,7 @@ public class KameletMain extends MainCommandLineSupport {
         addInitialProperty("camel.component.properties.ignore-missing-location", "true");
         PropertiesComponent pc = (PropertiesComponent) answer.getPropertiesComponent();
         pc.setPropertiesParser(new ExportPropertiesParser(answer));
-        pc.setPropertiesFunctionResolver(new DependencyDownloaderPropertiesFunctionResolver(answer, export));
+        pc.setPropertiesFunctionResolver(new DependencyDownloaderPropertiesFunctionResolver(answer, export, false));
 
         // override default type converters with our export converter that is more flexible during exporting
         ExportTypeConverter ec = new ExportTypeConverter();
diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderPropertiesFunctionResolver.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderPropertiesFunctionResolver.java
index 2766e8ef189d..5a01fae03229 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderPropertiesFunctionResolver.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderPropertiesFunctionResolver.java
@@ -17,8 +17,10 @@
 package org.apache.camel.main.download;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.component.properties.BooleanPropertiesFunction;
 import org.apache.camel.component.properties.DefaultPropertiesFunctionResolver;
 import org.apache.camel.spi.PropertiesFunction;
+import org.apache.camel.support.service.ServiceHelper;
 
 /**
  * Auto downloaded needed JARs when resolving properties functions.
@@ -26,11 +28,13 @@ import org.apache.camel.spi.PropertiesFunction;
 public class DependencyDownloaderPropertiesFunctionResolver extends DefaultPropertiesFunctionResolver {
 
     private final boolean export;
+    private final boolean transform;
 
-    public DependencyDownloaderPropertiesFunctionResolver(CamelContext camelContext, boolean export) {
+    public DependencyDownloaderPropertiesFunctionResolver(CamelContext camelContext, boolean export, boolean transform) {
         super();
         setCamelContext(camelContext);
         this.export = export;
+        this.transform = transform;
     }
 
     @Override
@@ -78,6 +82,14 @@ public class DependencyDownloaderPropertiesFunctionResolver extends DefaultPrope
                         getCamelContext().getVersion());
             }
         }
+        if ("boolean".equals(name) && transform) {
+            // ensure boolean function can fallback and return a value as we just want to transform
+            var bf = new ExportBooleanFunction();
+            bf.setCamelContext(getCamelContext());
+            ServiceHelper.startService(bf);
+            addPropertiesFunction(bf);
+
+        }
         PropertiesFunction answer = super.resolvePropertiesFunction(name);
         if (answer != null && export) {
             answer = new ExportPropertiesFunction(answer);
@@ -85,6 +97,18 @@ public class DependencyDownloaderPropertiesFunctionResolver extends DefaultPrope
         return answer;
     }
 
+    private static class ExportBooleanFunction extends BooleanPropertiesFunction {
+
+        @Override
+        public String apply(String remainder) {
+            try {
+                return super.apply(remainder);
+            } catch (Exception e) {
+                return "true";
+            }
+        }
+    }
+
     private static class ExportPropertiesFunction implements PropertiesFunction {
 
         private final PropertiesFunction delegate;


(camel) 04/04: CAMEL-16861: Update docs

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 65746971ab65ca65d7ae6fec4b3d24a90d635325
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Feb 25 19:06:34 2026 +0100

    CAMEL-16861: Update docs
---
 .../ROOT/pages/using-propertyplaceholder.adoc      | 446 ++++++++++++++++++---
 docs/user-manual/modules/ROOT/pages/validator.adoc |  56 ++-
 2 files changed, 430 insertions(+), 72 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
index 051d5d0aed27..126b76155e7c 100644
--- a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
@@ -719,29 +719,82 @@ The xref:components::properties-component.adoc[Properties] component includes th
 
 These functions are intended to make it easy to lookup values from the environment, as shown in the example below:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .to("{{env:SOMENAME}}")
+  .to("{{sys:MyJvmPropertyName}}");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <to uri="{{env:SOMENAME}}"/>
-        <to uri="{{sys:MyJvmPropertyName}}"/>
-    </route>
-</camelContext>
+<route>
+    <from uri="direct:start"/>
+    <to uri="{{env:SOMENAME}}"/>
+    <to uri="{{sys:MyJvmPropertyName}}"/>
+</route>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "{{env:SOMENAME}}"
+        - to:
+            uri: "{{sys:MyJvmPropertyName}}"
+----
+====
+
 You can use default values as well, so if the property does not exist, you can define a default value as shown below, where the default value is a `log:foo` and `log:bar` value.
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .to("{{env:SOMENAME:log:foo}}")
+  .to("{{sys:MyJvmPropertyName:log:bar}}");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <to uri="{{env:SOMENAME:log:foo}}"/>
-        <to uri="{{sys:MyJvmPropertyName:log:bar}}"/>
-    </route>
-</camelContext>
+<route>
+    <from uri="direct:start"/>
+    <to uri="{{env:SOMENAME:log:foo}}"/>
+    <to uri="{{sys:MyJvmPropertyName:log:bar}}"/>
+</route>
 ----
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "{{env:SOMENAME:log:foo}}"
+        - to:
+            uri: "{{sys:MyJvmPropertyName:log:bar}}"
+----
+====
 
 The boolean function is intended for more flexibility when enabling or disabling EIP options.
 
@@ -754,20 +807,59 @@ region = EMEA
 
 We can then configure EIPs whether they are disabled based on this condition as follows:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+    .choice().disabled("{{boolean:region == 'EMEA'}}")
+        .when(simple("${header.RetryAttempts} == null"))
+            .setProperty("HttpMessageMethod", constant("SET"))
+            .process("SetOriginalMessageProcessor")
+        .end();
+----
+
+XML::
++
+[source,xml]
+----
+<route>
+    <from uri="direct:start"/>
+    <choice disabled="{{boolean:region == 'EMEA'}}">
+        <when>
+            <simple>${header.RetryAttempts} == null</simple>
+            <setProperty name="HttpMessageMethod">
+                <constant>SET</constant>
+            </setProperty>
+            <process ref="SetOriginalMessageProcessor"/>
+        </when>
+    </choice>
+</route>
+----
+
+YAML::
++
 [source,yaml]
 ----
-    - choice:
-        disabled: "{{boolean:region == 'EMEA`}}"
-        when:
-        - simple: "${header.RetryAttempts} == null"
-          steps:
-          - setProperty:
-              name: "HttpMessageMethod"
-              constant: "SET"
-          - process:
-              ref: "SetOriginalMessageProcessor"
-    ...
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - choice:
+            disabled: "{{boolean:region == 'EMEA'}}"
+            when:
+            - simple: "${header.RetryAttempts} == null"
+              steps:
+              - setProperty:
+                  name: "HttpMessageMethod"
+                  constant: "SET"
+              - process:
+                  ref: "SetOriginalMessageProcessor"
 ----
+====
 
 TIP: The boolean function uses the xref:components:languages:simple-language.adoc[Simple] language which has many functions and operators to build the condition.
 
@@ -787,42 +879,114 @@ export $FOO_SERVICE_PORT=8888
 
 For example if the FOO service a remote HTTP service, then we can refer to the service in the Camel endpoint uri, and use the HTTP component to make the HTTP call:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .to("http://{{service:FOO}}/myapp");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <to uri="http://{{service:FOO}}/myapp"/>
-    </route>
-</camelContext>
+<route>
+    <from uri="direct:start"/>
+    <to uri="http://{{service:FOO}}/myapp"/>
+</route>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "http://{{service:FOO}}/myapp"
+----
+====
+
 And we can use default values if the service has not been defined, for example to call a service on localhost, maybe for unit testing.
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .to("http://{{service:FOO:localhost:8080}}/myapp");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
 <route>
     <from uri="direct:start"/>
     <to uri="http://{{service:FOO:localhost:8080}}/myapp"/>
 </route>
-</camelContext>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "http://{{service:FOO:localhost:8080}}/myapp"
+----
+====
+
 The bean function (you need to have `camel-bean` JAR on classpath) is for looking up the property from the return value of bean's method.
 
 Assuming we have registered a bean named 'foo' that has a method called 'bar' that returns a directory name, then we can refer to the bean's method in the camel endpoint url, and use the file component to poll a directory:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("file:{{bean:foo.bar}}")
+  .to("direct:result");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
 <route>
     <from uri="file:{{bean:foo.bar}}"/>
     <to uri="direct:result"/>
 </route>
-</camelContext>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: file:{{bean:foo.bar}}
+      steps:
+        - to:
+            uri: "direct:result"
+----
+====
+
 IMPORTANT: The method must be a public no-arg method (i.e. no parameters) and return a value such as a String, boolean, int.
 
 === Using Kubernetes property placeholder functions
@@ -836,7 +1000,7 @@ The `camel-kubernetes` component include the following functions:
 
 The syntax for both functions are:
 
-[source]
+[source,text]
 ----
 configmap:name/key[:defaultValue]
 ----
@@ -844,21 +1008,21 @@ configmap:name/key[:defaultValue]
 Where the default value is optional, for example the following will lookup `myKey`,
 and fail if there is no such configmap.
 
-[source]
+[source,text]
 ----
 configmap:mymap/mykey
 ----
 
 In this example then it would not fail as a default value is provided:
 
-[source]
+[source,text]
 ----
 configmap:mymap/mykey:123
 ----
 
 If the value stored in the configmap is in binary format, so it is stored as `Binary Data`, it will be downloaded in a file, and it returns the absolute path of the file
 
-[source]
+[source,text]
 ----
 configmap-binary:mymap/mybinkey
 ----
@@ -876,8 +1040,7 @@ Camel will first use _mount paths_ (if configured) to lookup, and then fallback
 
 The configuration of the _mount path_ are used by the given order:
 
-1. Reading configuration property with keys `camel.kubernetes-config.mount-path-configmaps`
-and `camel.kubernetes-config.mount-path-secrets`.
+1. Reading configuration property with keys `camel.kubernetes-config.mount-path-configmaps` and `camel.kubernetes-config.mount-path-secrets`.
 2. Use JVM system property with key `camel.k.mount-path.configmaps` and `camel.k.mount-path.secrets` (Camel K compatible).
 3. Use OS ENV variable with key `CAMEL_K_MOUNT_PATH_CONFIGMAPS` and `CAMEL_K_MOUNT_PATH_SECRETS` (Camel K compatible).
 
@@ -908,7 +1071,7 @@ camel.kubernetes-config.client.masterUrl = https://127.0.0.1:50179/
 camel.kubernetes-config.client.oauthToken = eyJhbGciOiJSUzI1NiIsImtpZCI...
 ----
 
-The `KubernetesClient` has many options, see the https://github.com/fabric8io/kubernetes-client documentation.
+TIP: The `KubernetesClient` has many options, see the https://github.com/fabric8io/kubernetes-client[Kubernetes Client] documentation for more information for these options.
 
 If you only use _mount paths_, then it is good practice to disable `KubernetesClient` which can be done by setting enabled to false as show:
 
@@ -935,23 +1098,83 @@ first = Carlsberg
 
 Then these values can be used in your Camel routes such as:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .log("What {{configmap:myconfig/drink}} do you want?")
+  .log("I want {{configmap:myconfig/first}}");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
   <route>
     <from uri="direct:start"/>
     <log message="What {{configmap:myconfig/drink}} do you want?"/>
     <log message="I want {{configmap:myconfig/first}}"/>
   </route>
-</camelContext>
 ----
 
-You can also provide a default value in case a key does not exist:
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - log:
+            message: "What {{configmap:myconfig/drink}} do you want?"
+        - log:
+            message: "I want {{configmap:myconfig/first}}"
+----
+====
+
+You can also provide a default value in case a key does not exist, such as `Heiniken` being the default value:
+
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .log("What {{configmap:myconfig/drink}} do you want?")
+  .log("I want {{configmap:myconfig/second:Heineken}}");
+----
 
+XML::
++
 [source,xml]
 ----
+  <route>
+    <from uri="direct:start"/>
+    <log message="What {{configmap:myconfig/drink}} do you want?"/>
     <log message="I want {{configmap:myconfig/second:Heineken}}"/>
+  </route>
+----
+
+YAML::
++
+[source,yaml]
 ----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - log:
+            message: "What {{configmap:myconfig/drink}} do you want?"
+        - log:
+            message: "I want {{configmap:myconfig/second:Heineken}}"
+----
+====
 
 ==== Using secrets with Kubernetes
 
@@ -968,11 +1191,34 @@ myuser = scott
 mypass = tiger
 ----
 
-This can be used in Camel with for example the Postrgres Sink Kamelet:
+This can be used in Camel with for example the Postgres Sink Kamelet:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+String sink =
+"""
+ kamelet:postgresql-sink?serverName={{secret:mydb/myhost}}?
+ &serverPort={{secret:mydb/myport}}
+ &username={{secret:mydb/myuser}}
+ &password={{secret:mydb/mypass}}
+ &databaseName=cities
+ &query=INSERT INTO accounts (username,city) VALUES (:#username,:#city)
+""";
+
+from("direct:rome")
+  .setBody(constant("{ \"username\":\"oscerd\", \"city\":\"Rome\"}"))
+  .to(sink);
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
   <route>
     <from uri="direct:rome"/>
     <setBody>
@@ -985,9 +1231,35 @@ This can be used in Camel with for example the Postrgres Sink Kamelet:
              &amp;databaseName=cities
              &amp;query=INSERT INTO accounts (username,city) VALUES (:#username,:#city)"/>
   </route>
-</camelContext>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct
+      parameters:
+        name: rome
+      steps:
+        - setBody:
+            expression:
+              constant:
+                expression: "{ \"username\":\"oscerd\", \"city\":\"Rome\"}"
+        - to:
+            uri: kamelet
+            parameters:
+              templateId: postgresql-sink
+              serverName: "{{secret:mydb/myhost}}"
+              serverPort: "{{secret:mydb/myport}}"
+              username: "{{secret:mydb/myuser}}"
+              password: "{{secret:mydb/mypass}}"
+              databaseName: 'cities'
+              query: "INSERT INTO accounts (username,city) VALUES (:#username,:#city)"
+----
+====
+
 The postgres-sink Kamelet can also be configured in `application.properties` which reduces the configuration
 in the route above:
 
@@ -1001,9 +1273,22 @@ camel.component.kamelet.postgresql-sink.password={{secret:mydb/mypass}}
 
 Which reduces the route to:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:rome")
+  .setBody(constant("{ \"username\":\"oscerd\", \"city\":\"Rome\"}"))
+  .to("kamelet:postgresql-sink?databaseName=cities&query=INSERT INTO accounts (username,city) VALUES (:#username,:#city)");
+----
+
+XML::
++
 [source,xml]
 ----
-<camelContext>
   <route>
     <from uri="direct:rome"/>
     <setBody>
@@ -1012,15 +1297,35 @@ Which reduces the route to:
     <to uri="kamelet:postgresql-sink?databaseName=cities
              &amp;query=INSERT INTO accounts (username,city) VALUES (:#username,:#city)"/>
   </route>
-</camelContext>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:rome
+      steps:
+        - setBody:
+            expression:
+              constant:
+                expression: "{ \"username\":\"oscerd\", \"city\":\"Rome\"}"
+        - to:
+            uri: kamelet
+            parameters:
+              templateId: postgresql-sink
+              databaseName: cities
+              query: "INSERT INTO accounts (username,city) VALUES (:#username,:#city)"
+----
+====
+
 ==== Using configmap or secrets in local-mode
 
-During development you may want to run in _local mode_ where you do not need acces to a Kubernetes cluster, to lookup the configmap.
+During development, you may want to run in _local mode_ where you do not need acces to a Kubernetes cluster, to lookup the configmap.
 In the local mode, then Camel will lookup the configmap _keys_ from local properties, eg:
 
-For example the example above with the postgresql kamelet, that was configured using a secret:
+For example the example above with the Postgres kamelet, that was configured using a secret:
 
 [source,properties]
 ----
@@ -1030,7 +1335,7 @@ camel.component.kamelet.postgresql-sink.username={{secret:mydb/myuser}}
 camel.component.kamelet.postgresql-sink.password={{secret:mydb/mypass}}
 ----
 
-Now suppose we have a local Postrgres database we want to use, then we can turn on _local mode_
+Now suppose we have a local Postgres database we want to use, then we can turn on _local mode_
 and specify the credentials in the same properties file:
 
 [source,properties]
@@ -1045,6 +1350,7 @@ mydb/mypass=tiger
 NOTE: Notice how the key is prefixed with the name of the secret and a slash, eg `name/key`. This makes it easy to copy/paste
 from the actual use of the configmap/secret and into the `application.properties` file.
 
+
 === Using custom property placeholder functions
 
 The xref:components::properties-component.adoc[Properties] component allow to plugin 3rd party functions which can be used during parsing of the property placeholders.
@@ -1053,6 +1359,20 @@ The name of the function becomes the prefix used in the placeholder.
 
 This is best illustrated in the example route below, where we use `beer` as the prefix:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+  .to("{{beer:FOO}}")
+  .to("{{beer:BAR}}");
+----
+
+XML::
++
 [source,xml]
 ----
 <route>
@@ -1062,6 +1382,21 @@ This is best illustrated in the example route below, where we use `beer` as the
 </route>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "{{beer:FOO}}"
+        - to:
+            uri: "{{beer:BAR}}"
+----
+====
+
 The implementation of the function is only two methods as shown below:
 
 [source,java]
@@ -1086,7 +1421,7 @@ The method `getName` is the name of the function (beer).
 And the `apply` method is where we implement the custom logic to do.
 As the sample code is from a unit test, it just returns a value to refer to a mock endpoint.
 
-You also need to have `camel-component-maven-plugin` as part of building the component will
+You also need to have `camel-component-maven-plugin` Maven plugin as part of building the component will
 then ensure that this custom properties function has necessary source code generated that makes Camel
 able to automatically discover the function.
 
@@ -1095,6 +1430,7 @@ and have this logic in `doStart` and `doStop` methods.
 
 TIP: For an example see the `camel-base64` component.
 
+
 == Using third party property sources
 
 The properties component allows to plugin 3rd party sources to load and lookup properties via the `PropertySource`
@@ -1113,7 +1449,7 @@ This is done by including the file `META-INF/services/org/apache/camel/property-
 
 See xref:components:others:microprofile-config.adoc[MicroProfile Config] component as an example.
 
-You can also register 3rd-party property sources via Java API:
+You can also register 3rd-party property sources via Java API on the `PropertiesComponent` as shown:
 
 [source,java]
 ----
diff --git a/docs/user-manual/modules/ROOT/pages/validator.adoc b/docs/user-manual/modules/ROOT/pages/validator.adoc
index e4376bee5325..d9fe47eba8a6 100644
--- a/docs/user-manual/modules/ROOT/pages/validator.adoc
+++ b/docs/user-manual/modules/ROOT/pages/validator.adoc
@@ -27,8 +27,8 @@ data type name.
 | Custom Validator | Validate with using custom validator class. Validator must be a subclass of `org.apache.camel.spi.Validator`
 |===
 
-
 == Common Options
+
 All validators have following common options to specify which data type is supported by the validator.
 `type` must be specified.
 
@@ -38,7 +38,6 @@ All validators have following common options to specify which data type is suppo
 | type | Data type to validate
 |===
 
-
 == Predicate Validator Options
 
 [width="100%",cols="25%,75%",options="header",]
@@ -49,8 +48,12 @@ All validators have following common options to specify which data type is suppo
 
 Here is an example to specify a validation predicate:
 
-Java DSL:
+[tabs]
+====
 
+
+Java::
++
 [source,java]
 ----
 validator()
@@ -58,14 +61,15 @@ validator()
     .withExpression(bodyAs(String.class).contains("{name:XOrder}"));
 ----
 
-XML DSL:
-
+Spring XML::
++
 [source,xml]
 ----
 <predicateValidator Type="csv:CSVOrder">
     <simple>${body} contains '{name:XOrder}'</simple>
 </predicateValidator>
 ----
+====
 
 == Endpoint Validator Options
 
@@ -78,6 +82,11 @@ XML DSL:
 
 Here is an example to specify endpoint URI in Java DSL:
 
+[tabs]
+====
+
+Java::
++
 [source,java]
 ----
 validator()
@@ -85,12 +94,13 @@ validator()
     .withUri("validator:xsd/schema.xsd");
 ----
 
-And here is an example to specify endpoint ref in XML DSL:
-
+Spring XML::
++
 [source,xml]
 ----
 <endpointValidator uri="validator:xsd/schema.xsd" type="xml"/>
 ----
+====
 
 Note that the Endpoint Validator just forwards the message to the specified endpoint. In above example,
 camel forwards the message to the `validator:` endpoint, which actually is a
@@ -110,8 +120,11 @@ The validator must be an implementation of `org.apache.camel.spi.Validator`
 
 Here is an example to specify custom Validator class:
 
-Java DSL:
+[tabs]
+====
 
+Java::
++
 [source,java]
 ----
 validator()
@@ -119,20 +132,24 @@ validator()
     .withJava(com.example.MyCustomValidator.class);
 ----
 
-XML DSL:
-
+Spring XML::
++
 [source,xml]
 ----
 <customTransformer className="com.example.MyCustomValidator" type="json"/>
 ----
+====
 
 == Examples
 
 For example to declare the Endpoint Validator which uses
 validator component to validate `xml:ABCOrder`, we can do as follows:
 
-Java DSL:
+[tabs]
+====
 
+Java::
++
 [source,java]
 ----
 validator()
@@ -140,8 +157,8 @@ validator()
     .withUri("validator:xsd/schema.xsd");
 ----
 
-And in XML DSL:
-
+Spring XML::
++
 [source,xml]
 ----
 <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
@@ -150,13 +167,17 @@ And in XML DSL:
     </validators>
 </camelContext>
 ----
+====
 
-If you have following route definition, above validator will be applied when `direct:abc` endpoint
+If you have the following route definition, above validator will be applied when `direct:abc` endpoint
 receives the message. Note that `inputTypeWithValidate` is used instead of `inputType` in Java DSL,
 and the `validate` attribute on the inputType declaration is set to `true` in XML DSL:
 
-Java DSL:
+[tabs]
+====
 
+Java::
++
 [source,java]
 ----
 from("direct:abc")
@@ -164,8 +185,8 @@ from("direct:abc")
     .log("${body}");
 ----
 
-XML DSL:
-
+Spring XML::
++
 [source,xml]
 ----
 <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
@@ -176,6 +197,7 @@ XML DSL:
     </route>
 </camelContext>
 ----
+====
 
 == See Also
 


(camel) 02/04: CAMEL-16861: Update docs

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a897a114d7f4cffe08780ecad38eb7d37dd41b2b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Feb 25 14:09:09 2026 +0100

    CAMEL-16861: Update docs
---
 .../ROOT/pages/using-propertyplaceholder.adoc      | 365 +++++++++++++++++----
 1 file changed, 309 insertions(+), 56 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
index ae7b806d6995..051d5d0aed27 100644
--- a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
@@ -18,7 +18,6 @@ from the core, which is responsible for handling and resolving the property plac
 See the xref:components::properties-component.adoc[Properties] documentation for how
 to configure Camel to known from which location(a) to load properties.
 
-
 == Property placeholder syntax
 
 The value of a Camel property can be obtained by specifying its key name
@@ -33,10 +32,54 @@ For example:
 
 where `file.uri` is the property key.
 
-Property placeholders can be used to specify parts, or all, of an
-endpoint's URI by embedding one or more placeholders in the URI's string
+Property placeholders can for example be used to specify parts, or all, of an
+xref:uris.adoc[endpoint uri] by embedding one or more placeholders in the URI's string
 definition.
 
+For example as shown in the route below:
+
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("{{file.uri}}")
+  .to("kafka:{{orderTopic}}");
+----
+
+XML::
++
+[source,xml]
+----
+    <route>
+        <from uri="{{file.uri}}"/>
+        <to uri="kafka:{{orderTopic}}"/>
+    </route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: "{{file.uri}}"
+      steps:
+        - to:
+            uri: "kafka:{{orderTopic}}"
+----
+====
+
+Then the placeholder can be declared in `application.properties`:
+
+[source,properties]
+----
+file.uri = file:/var/orders/inbox?recursive=true
+----
+
+
 === Using property placeholder with default value
 
 You can specify a default value to use if a
@@ -52,7 +95,7 @@ In this case the default value is `/some/path`.
 === Using optional property placeholders
 
 Camel's elaborate property placeholder feature supports optional placeholders,
-which is defined with the `?` (question mark) as prefix in the key name, as shown:
+which is declared with the `?` (question mark) as prefix in the key name, as shown:
 
 [source,text]
 ----
@@ -60,7 +103,7 @@ which is defined with the `?` (question mark) as prefix in the key name, as show
 ----
 
 If a value for the key exists then the value is used, however if the key does not exist,
-then Camel understands this, such as when used in xref:endpoint.adoc[Endpoints]:
+then Camel understands how to handle this. For example when used in xref:endpoint.adoc[Endpoints]:
 
 [source,text]
 ----
@@ -68,35 +111,80 @@ file:foo?bufferSize={{?myBufferSize}}
 ----
 
 Then the `bufferSize` option will only be configured in the endpoint, if a placeholder exists.
-Otherwise the option will not be set on the endpoint, meaning the endpoint would be _restructued_ as:
+Otherwise, the option will not be set on the endpoint, meaning the endpoint would be _restructured_ as:
 
 [source,text]
 ----
 file:foo
 ----
 
-Then the option `bufferSize` is not in specified at all, and this would allow Camel to
-use the standard default value for `bufferSize` if any exists.
+Then the option `bufferSize` is not declared, and this would allow Camel to
+use the standard default value for `bufferSize` (if any exists).
 
 === Reverse a boolean value
 
 If a property placeholder is a boolean value, then it is possible to negate (reverse) the value by using `!` as prefix in the key.
 
+For example given we have this property:
+
 [source,properties]
 ----
 integration.ftpEnabled=true
 ----
 
+Then this can be used to control which routes should be auto started.
+
+[tabs]
+====
+
+Java::
++
 [source,java]
 ----
 from("ftp:....").autoStartup("{{integration.ftpEnabled}}")
-    .to("kafka:cheese")
+    .to("kafka:cheese");
 
 from("jms:....").autoStartup("{{!integration.ftpEnabled}}")
-    .to("kafka:cheese")
+    .to("kafka:cheese");
 ----
 
-In the example above then the FTP route or the JMS route should only be started. So if the FTP is enabled then JMS should be disable, and vise-versa.
+XML::
++
+[source,xml]
+----
+<route autoStartup="{{integration.ftpEnabled}}">
+    <from uri="ftp:...."/>
+    <to uri="kafka:cheese"/>
+</route>
+
+<route autoStartup="{{!integration.ftpEnabled}}">
+    <from uri="jms:...."/>
+    <to uri="kafka:cheese"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+    autoStartup: "{{integration.ftpEnabled}}"
+    from:
+      uri: ftp:....
+      steps:
+        - to:
+            uri: kafka:cheese
+- route:
+    autoStartup: "{{!integration.ftpEnabled}}"
+    from:
+      uri: jms:....
+      steps:
+        - to:
+            uri: kafka:cheese
+----
+====
+
+In the example above then the FTP route or the JMS route should only be started. So if the FTP is enabled then JMS should be disabled, and vice versa.
 We can do this be negating the `autoStartup` in the JMS route, by using `!integration.ftpEnabled` as the key.
 
 
@@ -110,16 +198,19 @@ cool.end = mock:result
 where = cheese
 ----
 
-And in Java DSL:
+[tabs]
+====
 
+Java::
++
 [source,java]
 ----
 from("direct:start")
     .to("{{cool.end}}");
 ----
 
-And in XML DSL:
-
+XML::
++
 [source,xml]
 ----
 <route>
@@ -128,7 +219,21 @@ And in XML DSL:
 </route>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "{{cool.end}}"
+----
+====
+
 A property placeholder may also just be a one part in the endpoint URI.
+
 A common use-case is to use a placeholder for an endpoint option such
 as the size of the write buffer in the file endpoint:
 
@@ -137,14 +242,19 @@ as the size of the write buffer in the file endpoint:
 buf = 8192
 ----
 
+[tabs]
+====
+
+Java::
++
 [source,java]
 ----
 from("direct:start")
     .to("file:outbox?bufferSize={{buf}}");
 ----
 
-And in XML DSL:
-
+XML::
++
 [source,xml]
 ----
 <route>
@@ -153,14 +263,55 @@ And in XML DSL:
 </route>
 ----
 
-However the placeholder can be anywhere, so it could also be the name of a mock endpoint
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "file:outbox?bufferSize={{buf}}"
+----
+====
+
+However, the placeholder can be anywhere, so it could also be the name of a mock endpoint
+
+[tabs]
+====
 
+Java::
++
 [source,java]
 ----
 from("direct:start")
     .to("mock:{{where}}");
 ----
 
+XML::
++
+[source,xml]
+----
+<route>
+    <from uri="direct:start"/>
+    <to uri="mock:{{where}}"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "mock:{{where}}"
+----
+====
+
 In the example above the mock endpoint, is already hardcoded to start with `mock:`,
 and the `where` placeholder has the value `cheese` so the resolved uri becomes `mock:cheese`.
 
@@ -174,39 +325,92 @@ cool.foo=result
 cool.concat=mock:{{cool.foo}}
 ----
 
-Notice how `cool.concat` refer to another property.
+Notice how `cool.concat` refer to another property (above).
+
+You can then use the `cool.concat` placeholder in the Camel routes:
 
-And the route in XML:
+[tabs]
+====
 
+Java::
++
+[source,java]
+----
+from("direct:start")
+    .to("{{cool.concat}}");
+----
+
+XML::
++
 [source,xml]
 ----
 <route>
-  <from uri="direct:start"/>
-  <to uri="{{cool.concat}}"/>
+    <from uri="direct:start"/>
+    <to uri="{{cool.concat}}"/>
 </route>
 ----
 
-==== Turning off nested placeholders
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "{{cool.concat}}"
+----
+====
+
+
+==== Turning off nested placeholders (advanced)
 
 If the placeholder value contains data that interfere with the property placeholder syntax `{{` and `}}` (such as JSon data),
 you can be then explicit turn off nested placeholder by `?nested=false` in the key name, such as shown:
 
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("direct:start")
+    .to("elasticsearch:foo?query={{myQuery?nested=false}}");
+----
+
+XML::
++
 [source,xml]
 ----
 <route>
-  <from uri="direct:start"/>
-  <to uri="elasticsearch:foo?query={{myQuery?nested=false}}"/>
+    <from uri="direct:start"/>
+    <to uri="elasticsearch:foo?query={{myQuery?nested=false}}"/>
 </route>
 ----
 
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "elasticsearch:foo?query={{myQuery?nested=false}}"
+----
+====
+
 In the example above the placeholder _myQuery_ placeholder value is as follows
 
-[source,json]
+[source,properties]
 ----
-{"query":{"match_all":{}}}
+myQuery = {"query":{"match_all":{}}}
 ----
 
-Notice how the json query ends with `}}` which interfere with the Camel property placeholder syntax.
+Notice how the JSon query ends with `}}` which interfere with the Camel property placeholder syntax.
 
 Nested placeholders can also be turned off globally on the xref:components::properties-component.adoc[Properties] component, such as:
 
@@ -216,12 +420,22 @@ CamelContext context = ...
 context.getPropertiesComponent().setNestedPlaceholder(false);
 ----
 
-=== Escape a property placeholder
+In the situation with the JSon query ending with `}}` which clashes with Camels property placeholder syntax, then its also possible
+to use escaping as explained in the following section.
+
+==== Escaping a property placeholder
 
 The property placeholder can be problematic if the double curly brackets are used by a third party library like for example a query in ElasticSearch of type `{"query":{"match_all":{}}}`.
 
 To work around that it is possible to escape the double curly brackets with a backslash character like for example `\{{ property-name \}}`. This way, it won't be interpreted as a property placeholder to resolve and will be resolved as `{{ property-name }}`.
 
+The previous example can then use escaping (see how the value ends with `\\}}`)
+
+[source,properties]
+----
+myQuery = {"query":{"match_all":{}\\}}
+----
+
 If for some reason, the backslash character before the double curly brackets must not be interpreted as an escape character, it is possible to add another backslash in front of it to escape it, it will then be seen as a backslash.
 
 === Using property placeholders multiple times
@@ -237,6 +451,11 @@ cool.result=result
 
 And in this route we use `cool.start` two times:
 
+[tabs]
+====
+
+Java::
++
 [source,java]
 ----
 from("{{cool.start}}")
@@ -244,7 +463,33 @@ from("{{cool.start}}")
     .to("mock:{{cool.result}}");
 ----
 
-=== Using property placeholders with producer template
+XML::
++
+[source,xml]
+----
+<route>
+    <from uri="{{cool.start}}"/>
+    <to uri="log:{{cool.start}}?showBodyType=false&amp;showExchangeId={{cool.showid}}"/>
+    <to uri="mock:{{cool.result}}"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+    from:
+      uri: direct:start
+      steps:
+        - to:
+            uri: "log:{{cool.start}}?showBodyType=false&showExchangeId={{cool.showid}}"
+        - to:
+            uri: "mock:{{cool.result}}"
+----
+====
+
+=== Using property placeholders with consumer and producer templates
 
 You can also your property placeholders when using
 xref:producertemplate.adoc[ProducerTemplate] for example:
@@ -254,8 +499,6 @@ xref:producertemplate.adoc[ProducerTemplate] for example:
 template.sendBody("{{cool.start}}", "Hello World");
 ----
 
-=== Using property placeholders with consumer template
-
 This can also be done when using xref:consumertemplate.adoc[ConsumerTemplate], such as:
 
 [source,java]
@@ -263,26 +506,6 @@ This can also be done when using xref:consumertemplate.adoc[ConsumerTemplate], s
 Object body = template.receiveBody("{{cool.start}}");
 ----
 
-== Resolving property placeholders on cloud
-
-When you are running your Camel application on the cloud you may want to automatically scan any Configmap or Secret as it was an application properties. Given the following Secret:
-
-----
-apiVersion: v1
-data:
-  my-property: Q2FtZWwgNC44
-kind: Secret
-metadata:
-  name: my-secret
-type: Opaque
-----
-
-You can mount it in your Pod container, for instance, under `/etc/camel/conf.d/_secrets/my-secret`. Now, just make your Camel application be aware where to scan your configuration via `camel.main.cloud-properties-location = /etc/camel/conf.d/_secrets/my-secret` application properties. It's a comma separated value, so, you can add as many Secrets/Configmaps you need.
-
-At runtime, you will be able to read the configuration transparently as ```{{ my-property }}``` as you're doing with the rest of properties.
-
-NOTE: the same configuration works with Configmap.
-
 == Resolving property placeholders from Java code
 
 If you need to resolve property placeholder(s) from some Java code, then Camel has two APIs for this:
@@ -304,7 +527,7 @@ if (prop.isPresent()) {
 This API is to lookup a single property and returns a `java.util.Optional` type.
 
 The `CamelContext` have another API which is capable of resolving multiple placeholders, and interpolate placeholders from an input String.
-Lets try with an example to explain this:
+Let's try with an example to explain this:
 
 [source,java]
 ----
@@ -326,11 +549,38 @@ Will be resolved to:
 Hi Camel user, Camel is awesome dont you think?
 ----
 
-== Using property placeholders for any kind of attribute in Spring XML files
+== Resolving property placeholders on cloud
+
+When you are running your Camel application on the cloud you may want to automatically scan any Configmap or Secret as it was an application properties. Given the following Secret:
+
+[source,yaml]
+----
+apiVersion: v1
+data:
+  my-property: Q2FtZWwgNC44
+kind: Secret
+metadata:
+  name: my-secret
+type: Opaque
+----
+
+You can mount it in your Pod container, for instance, under `/etc/camel/conf.d/_secrets/my-secret`. Now, just make your Camel application be aware where to scan your configuration via `camel.main.cloud-properties-location = /etc/camel/conf.d/_secrets/my-secret` application properties. It's a comma separated value, so, you can add as many Secrets/Configmaps you need.
+
+At runtime, you will be able to read the configuration transparently as ```{{ my-property }}``` as you're doing with the rest of properties.
+
+NOTE: the same configuration works with Configmap.
+
+
+== Special features for legacy Spring XML files
+
+Apache Camel started decade(s) ago when Spring Framework was heavily used with Spring XML files.
+This means Camel has special features that apply only to Spring XML.
+
+=== Using property placeholders for any kind of attribute in Spring XML files
 
 Previously it was only the `xs:string` type attributes in the XML DSL
 that support placeholders. For example often a timeout attribute would
-be a `xs:int` type and thus you cannot set a string value as the
+be a `xs:int` type, and thus you cannot set a string value as the
 placeholder key. This is now possible using a special
 placeholder namespace.
 
@@ -363,6 +613,7 @@ To configure the option we must then use the `prop:optionName` as shown below:
 
 The complete example is below:
 
+.Spring XML
 [source,xml]
 ----
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -397,8 +648,7 @@ In our properties file we have the value defined as:
 stop = true
 ----
 
-
-== Bridging Camel property placeholders with Spring XML files
+=== Bridging Camel property placeholders with Spring XML files
 
 NOTE: If you are using Spring Boot then this does not apply.
 This is only for legacy Camel and Spring applications which are using Spring XML files.
@@ -414,6 +664,7 @@ type.
 
 To bridge Spring and Camel you must define a single bean as shown below:
 
+.Spring XML
 [source,xml]
 ----
 <!-- bridge spring property placeholder with Camel -->
@@ -430,6 +681,7 @@ After declaring this bean, you can define property placeholders using
 both the Spring style, and the Camel style within the `<camelContext>`
 tag as shown below:
 
+.Spring XML
 [source,xml]
 ----
 <!-- a bean that uses Spring property placeholder -->
@@ -452,6 +704,7 @@ Notice how the hello bean is using pure Spring property placeholders using
 the `${}` notation. And in the Camel routes we use the Camel
 placeholder notation with `{\{key}}`.
 
+
 == Using property placeholder functions
 
 The xref:components::properties-component.adoc[Properties] component includes the following functions out of the box:


(camel) 01/04: CAMEL-16861: Update docs

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c6c0b1ba6cb2ebc338dc545e07bb217e2632a7c3
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Feb 25 13:30:14 2026 +0100

    CAMEL-16861: Update docs
---
 .../pages/using-exchange-pattern-annotations.adoc  | 62 +++++++++-------------
 .../modules/ROOT/pages/uuidgenerator.adoc          | 52 +++++++++++-------
 2 files changed, 58 insertions(+), 56 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/using-exchange-pattern-annotations.adoc b/docs/user-manual/modules/ROOT/pages/using-exchange-pattern-annotations.adoc
index b86fc5f56236..84a13da4ff2e 100644
--- a/docs/user-manual/modules/ROOT/pages/using-exchange-pattern-annotations.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-exchange-pattern-annotations.adoc
@@ -1,11 +1,10 @@
 = Using Exchange Pattern Annotations
 
-Invoking InOut methods for ref:components:eips:requestReply-eip.adoc[request/reply] when working with xref:pojo-producing.adoc[POJO Producing] is typically synchronous. As such, the caller will block until the server returns a result.
+Invoking InOut methods for xref:components:eips:requestReply-eip.adoc[request/reply] when
+working with xref:pojo-producing.adoc[POJO Producing] is typically synchronous.
+As such, the caller will block until the server returns a result.
 
-[NOTE]
-====
-InOut means that there is an In message for  the input and an Out for the output/result.
-====
+InOut means that there is an In message for the input and an Out for the output/result.
 
 [NOTE]
 ====
@@ -14,18 +13,15 @@ Other books, posts and reference guides may use the terms In/Out and In/Only for
 
 You can also implement support for xref:components:eips:event-message.adoc[Event Messages] with Apache Camel, using the InOnly xref:exchange-pattern.adoc[pattern]. These are often called "fire and forget" (i.e., like sending a JMS message but not waiting for any response).
 
-Since version 1.5 Camel supports annotations for specifying the message
-exchange pattern on Java methods, classes or interfaces.
+== Specifying InOnly and InOut methods
 
-[[UsingExchangePatternAnnotations-SpecifyingInOnlymethods]]
-== Specifying InOnly methods
-
-Typically the InOut pattern is what most users want, but you can
+Typically, the InOut pattern is what most users want, but you can
 customize to use InOnly using an annotation. For instance:
 
-[source,syntaxhighlighter-pre]
+[source,java]
 ----
 public interface Foo {
+
   Object someInOutMethod(String input);
   String anotherInOutMethod(Cheese input);
   
@@ -35,16 +31,16 @@ public interface Foo {
 ----
 
 The above code shows three methods on an interface:
+
 * the first two use the default InOut mechanism
-* the third one, `someInOnlyMethod` uses the InOnly annotation to specify it as being a one-way method call.
+* the third one, `someInOnlyMethod` uses the `@InOnly` annotation to specify it as being a one-way method call.
 
-[[UsingExchangePatternAnnotations-Classlevelannotations]]
 == Class level annotations
 
 You can also use class level annotations to default all methods in an
 interface to a pattern:
 
-[source,syntaxhighlighter-pre]
+[source,java]
 ----
 @InOnly
 public interface Foo {
@@ -55,22 +51,21 @@ public interface Foo {
 
 Apache Camel will detect annotations on base classes or interfaces. For instance, suppose you created a client side proxy for the following code:
 
-[source,syntaxhighlighter-pre]
+[source,java]
 ----
 public class MyFoo implements Foo {
   ...
 }
 ----
 
-In this case, the methods inherited from Foo would be InOnly.
-
-[[UsingExchangePatternAnnotations-Overloadingaclasslevelannotation]]
-== Overloading a class level annotation
+In this case, the methods inherited from Foo would all be `@InOnly`.
 
+=== Overloading a class level annotation
 
-You can overload a class level annotation on specific methods. Suppose you have a class or interface with many InOnly methods, but you want to annote just one or two methods as InOut. You can do it like this:
+You can overload a class level annotation on specific methods. Suppose you have a class or interface with many `@InOnly` methods, but you want to annotate just one or two methods as `@InOut`.
+You can do it like this:
 
-[source,syntaxhighlighter-pre]
+[source,java]
 ----
 @InOnly
 public interface Foo {
@@ -82,38 +77,31 @@ public interface Foo {
 }
 ----
 
-In the above `Foo` interface the only the `someInOutMethod` will be InOut.
+In the above `Foo` interface only the `someInOutMethod` will be `@InOut`, and all the others will be `@InOnly`.
 
-[[UsingExchangePatternAnnotations-Usingyourownannotations]]
-== Using your own annotations
+== Using your own annotations for exchange patterns
 
 You might want to create your own annotations to represent a group of
 different bits of metadata; such as combining synchrony, concurrency and
-transaction behaviour.
+transaction behavior.
 
 In this case you can annotate your annotation with the `@Pattern` annotation to the default exchange pattern you wish to use.
 
-For example, lets say we want to create our own annotation called
-`@MyAsyncService`:
+For example, lets say we want to create our own annotation called `@MyAsyncService`:
 
-[source,syntaxhighlighter-pre]
+[source,java]
 ----
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.TYPE, ElementType.METHOD})
-
-// lets add the message exchange pattern to it
+// specify the message pattern
 @Pattern(ExchangePattern.InOnly)
-
-// lets add some other annotations - maybe transaction behaviour?
-
 public @interface MyAsyncService {
 }
 ----
 
-Now we can use this annotation, and Camel will figure out the correct
-exchange pattern.
+Now we can use this annotation, and Camel will figure out the correct exchange pattern.
 
-[source,syntaxhighlighter-pre]
+[source,java]
 ----
 public interface Foo {
   void someInOnlyMethod(Document input);
diff --git a/docs/user-manual/modules/ROOT/pages/uuidgenerator.adoc b/docs/user-manual/modules/ROOT/pages/uuidgenerator.adoc
index 14f80a59d919..a3205a44992d 100644
--- a/docs/user-manual/modules/ROOT/pages/uuidgenerator.adoc
+++ b/docs/user-manual/modules/ROOT/pages/uuidgenerator.adoc
@@ -5,22 +5,47 @@ Camel supports third-party UUID generator(s).
 A useful scenario is to use a simple counter for testing purpose. With this, it is
 easier to correlate the exchanges in the log/debugger.
 
-Camel uses UUIDs in the exchange and message ids, and other unique ids
-it uses.
+Camel uses UUIDs in the exchange and message ids, and other unique ids it uses.
 
 You only have to implement `org.apache.camel.spi.UuidGenerator` and tell
 Camel, that it should use your custom implementation:
 
-== Configuring UuidGenerator
+== Standard UUID Generators
 
-[source,java]
+Camel comes with the following implementations out of the box:
+
+* `org.apache.camel.support.ClassicUuidGenerator`: this is the classic Camel 2.x generator
+* `org.apache.camel.support.DefaultUuidGenerator`: default generator (32 chars) optimized for Camel usage
+* `org.apache.camel.support.ShortUuidGenerator`: Is 50% the size of the default (16 chars) optimized for Camel usage
+* `org.apache.camel.support.SimpleUuidGenerator`: This implementation uses
+internally a `java.util.concurrent.atomic.AtomicLong` and increases the
+ID for every call by one. Starting with 1 as the first id.
+* `org.apache.camel.support.RandomUuidGenerator`: type 4 (pseudo randomly generated) UUID. 
+The UUID is generated using a cryptographically strong pseudo random number generator.
+
+You can configure which standard generator to use in `application.properties`:
+
+[source,properties]
 ----
-getContext().setUuidGenerator(new MyCustomUuidGenerator());
+camel.main.uuidGenerator = simple
 ----
 
-Camel will configure this UUID generator by doing a lookup in the Spring
-bean registry to find the bean of the type `org.apache.camel.spi.UuidGenerator`.
+=== Configuring custom UuidGenerator
+
+You can implement a custom `UuidGenerator` which you can set up in Camel to use:
+
+[tabs]
+====
 
+Java::
++
+[source,java]
+----
+camelContext.setUuidGenerator(new MyCustomUuidGenerator());
+----
+
+Spring XML::
++
 [source,xml]
 ----
 <bean id="simpleUuid" class="org.apache.camel.support.SimpleUuidGenerator" />
@@ -33,15 +58,4 @@ bean registry to find the bean of the type `org.apache.camel.spi.UuidGenerator`.
 </camelContext>
 ----
 
-== Standard UUID Generators
-
-Camel comes with the following implementations out of the box:
-
-* `org.apache.camel.support.ClassicUuidGenerator`: this is the classic Camel 2.x generator
-* `org.apache.camel.support.DefaultUuidGenerator`: default generator (32 chars) optimized for Camel usage
-* `org.apache.camel.support.ShortUuidGenerator`: Is 50% the size of the default (16 chars) optimized for Camel usage
-* `org.apache.camel.support.SimpleUuidGenerator`: This implementation uses
-internally a `java.util.concurrent.atomic.AtomicLong` and increases the
-ID for every call by one. Starting with 1 as the first id.
-* `org.apache.camel.support.RandomUuidGenerator`: type 4 (pseudo randomly generated) UUID. 
-The UUID is generated using a cryptographically strong pseudo random number generator.
\ No newline at end of file
+====