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


The following commit(s) were added to refs/heads/main by this push:
     new 177d466d5d7b CAMEL-16861: Update docs
177d466d5d7b is described below

commit 177d466d5d7b4bfe3326344f3b90264831444a12
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Feb 25 07:44:55 2026 +0100

    CAMEL-16861: Update docs
---
 .../main/camel-main-configuration-metadata.json    |   3 +-
 .../MainConfigurationPropertiesConfigurer.java     |   7 ++
 .../camel-main-configuration-metadata.json         |   3 +-
 core/camel-main/src/main/docs/main.adoc            |   5 +-
 .../camel/main/DefaultConfigurationConfigurer.java |   8 ++
 .../camel/main/DefaultConfigurationProperties.java |  24 ++++
 .../modules/ROOT/pages/stream-caching.adoc         | 129 +++++++++++++++++++--
 7 files changed, 168 insertions(+), 11 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index b22a2f3172d1..cf5cacf653d8 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -139,8 +139,9 @@
     { "name": "camel.main.streamCachingSpoolCipher", "required": false, 
"description": "Sets a stream caching cipher name to use when spooling to disk 
to write with encryption. By default the data is not encrypted.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.main.streamCachingSpoolDirectory", "required": false, 
"description": "Sets the stream caching spool (temporary) directory to use for 
overflow and spooling to disk. If no spool directory has been explicit 
configured, then a temporary directory is created in the java.io.tmpdir 
directory.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.main.streamCachingSpoolEnabled", "required": false, 
"description": "To enable stream caching spooling to disk. This means, for 
large stream messages (over 128 KB by default) will be cached in a temporary 
file instead, and Camel will handle deleting the temporary file once the cached 
stream is no longer necessary. Default is false.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", 
"javaType": "boolean", "defaultValue": false, " [...]
+    { "name": "camel.main.streamCachingSpoolRules", "required": false, 
"description": "Sets custom rules 
(org.apache.camel.spi.StreamCachingStrategy.SpoolRule) for deciding when to 
spool to disk. Multiple rules can be separated by comma.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.main.streamCachingSpoolThreshold", "required": false, 
"description": "Stream caching threshold in bytes when overflow to disk is 
activated. The default threshold is 128kb. Use -1 to disable overflow to 
disk.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", 
"type": "integer", "javaType": "long", "secret": false },
-    { "name": "camel.main.streamCachingSpoolUsedHeapMemoryLimit", "required": 
false, "description": "Sets what the upper bounds should be when 
streamCachingSpoolUsedHeapMemoryThreshold is in use.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
+    { "name": "camel.main.streamCachingSpoolUsedHeapMemoryLimit", "required": 
false, "description": "Sets what the upper bounds should be when 
streamCachingSpoolUsedHeapMemoryThreshold is in use.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "enum", 
"javaType": "java.lang.String", "defaultValue": "Max", "secret": false, "enum": 
[ "Committed", "Max" ] },
     { "name": "camel.main.streamCachingSpoolUsedHeapMemoryThreshold", 
"required": false, "description": "Sets a percentage (1-99) of used heap memory 
threshold to activate stream caching spooling to disk.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", 
"javaType": "int", "secret": false },
     { "name": "camel.main.streamCachingStatisticsEnabled", "required": false, 
"description": "Sets whether stream caching statistics is enabled.", 
"sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": 
"boolean", "javaType": "boolean", "defaultValue": false, "secret": false },
     { "name": "camel.main.threadNamePattern", "required": false, 
"description": "Sets the thread name pattern used for creating the full thread 
name. The default pattern is: Camel (#camelId#) thread ##counter# - #name# 
Where #camelId# is the name of the CamelContext. and #counter# is a unique 
incrementing counter. and #name# is the regular thread name. You can also use 
#longName# which is the long thread name which can includes endpoint parameters 
etc.", "sourceType": "org.apache.camel.m [...]
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
index 2d401446988b..5ee376adff5d 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
@@ -132,6 +132,7 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         map.put("StreamCachingSpoolCipher", java.lang.String.class);
         map.put("StreamCachingSpoolDirectory", java.lang.String.class);
         map.put("StreamCachingSpoolEnabled", boolean.class);
+        map.put("StreamCachingSpoolRules", java.lang.String.class);
         map.put("StreamCachingSpoolThreshold", long.class);
         map.put("StreamCachingSpoolUsedHeapMemoryLimit", 
java.lang.String.class);
         map.put("StreamCachingSpoolUsedHeapMemoryThreshold", int.class);
@@ -369,6 +370,8 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         case "streamCachingSpoolDirectory": 
target.setStreamCachingSpoolDirectory(property(camelContext, 
java.lang.String.class, value)); return true;
         case "streamcachingspoolenabled":
         case "streamCachingSpoolEnabled": 
target.setStreamCachingSpoolEnabled(property(camelContext, boolean.class, 
value)); return true;
+        case "streamcachingspoolrules":
+        case "streamCachingSpoolRules": 
target.setStreamCachingSpoolRules(property(camelContext, 
java.lang.String.class, value)); return true;
         case "streamcachingspoolthreshold":
         case "streamCachingSpoolThreshold": 
target.setStreamCachingSpoolThreshold(property(camelContext, long.class, 
value)); return true;
         case "streamcachingspoolusedheapmemorylimit":
@@ -625,6 +628,8 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         case "streamCachingSpoolDirectory": return java.lang.String.class;
         case "streamcachingspoolenabled":
         case "streamCachingSpoolEnabled": return boolean.class;
+        case "streamcachingspoolrules":
+        case "streamCachingSpoolRules": return java.lang.String.class;
         case "streamcachingspoolthreshold":
         case "streamCachingSpoolThreshold": return long.class;
         case "streamcachingspoolusedheapmemorylimit":
@@ -877,6 +882,8 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         case "streamCachingSpoolDirectory": return 
target.getStreamCachingSpoolDirectory();
         case "streamcachingspoolenabled":
         case "streamCachingSpoolEnabled": return 
target.isStreamCachingSpoolEnabled();
+        case "streamcachingspoolrules":
+        case "streamCachingSpoolRules": return 
target.getStreamCachingSpoolRules();
         case "streamcachingspoolthreshold":
         case "streamCachingSpoolThreshold": return 
target.getStreamCachingSpoolThreshold();
         case "streamcachingspoolusedheapmemorylimit":
diff --git 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index b22a2f3172d1..cf5cacf653d8 100644
--- 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -139,8 +139,9 @@
     { "name": "camel.main.streamCachingSpoolCipher", "required": false, 
"description": "Sets a stream caching cipher name to use when spooling to disk 
to write with encryption. By default the data is not encrypted.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.main.streamCachingSpoolDirectory", "required": false, 
"description": "Sets the stream caching spool (temporary) directory to use for 
overflow and spooling to disk. If no spool directory has been explicit 
configured, then a temporary directory is created in the java.io.tmpdir 
directory.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.main.streamCachingSpoolEnabled", "required": false, 
"description": "To enable stream caching spooling to disk. This means, for 
large stream messages (over 128 KB by default) will be cached in a temporary 
file instead, and Camel will handle deleting the temporary file once the cached 
stream is no longer necessary. Default is false.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", 
"javaType": "boolean", "defaultValue": false, " [...]
+    { "name": "camel.main.streamCachingSpoolRules", "required": false, 
"description": "Sets custom rules 
(org.apache.camel.spi.StreamCachingStrategy.SpoolRule) for deciding when to 
spool to disk. Multiple rules can be separated by comma.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
     { "name": "camel.main.streamCachingSpoolThreshold", "required": false, 
"description": "Stream caching threshold in bytes when overflow to disk is 
activated. The default threshold is 128kb. Use -1 to disable overflow to 
disk.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", 
"type": "integer", "javaType": "long", "secret": false },
-    { "name": "camel.main.streamCachingSpoolUsedHeapMemoryLimit", "required": 
false, "description": "Sets what the upper bounds should be when 
streamCachingSpoolUsedHeapMemoryThreshold is in use.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "secret": false },
+    { "name": "camel.main.streamCachingSpoolUsedHeapMemoryLimit", "required": 
false, "description": "Sets what the upper bounds should be when 
streamCachingSpoolUsedHeapMemoryThreshold is in use.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "enum", 
"javaType": "java.lang.String", "defaultValue": "Max", "secret": false, "enum": 
[ "Committed", "Max" ] },
     { "name": "camel.main.streamCachingSpoolUsedHeapMemoryThreshold", 
"required": false, "description": "Sets a percentage (1-99) of used heap memory 
threshold to activate stream caching spooling to disk.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", 
"javaType": "int", "secret": false },
     { "name": "camel.main.streamCachingStatisticsEnabled", "required": false, 
"description": "Sets whether stream caching statistics is enabled.", 
"sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": 
"boolean", "javaType": "boolean", "defaultValue": false, "secret": false },
     { "name": "camel.main.threadNamePattern", "required": false, 
"description": "Sets the thread name pattern used for creating the full thread 
name. The default pattern is: Camel (#camelId#) thread ##counter# - #name# 
Where #camelId# is the name of the CamelContext. and #counter# is a unique 
incrementing counter. and #name# is the regular thread name. You can also use 
#longName# which is the long thread name which can includes endpoint parameters 
etc.", "sourceType": "org.apache.camel.m [...]
diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index 0fbf6ed387cd..801ea9d02b37 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -19,7 +19,7 @@ The following tables lists all the options:
 
 // main options: START
 === Camel Main configurations
-The camel.main supports 125 options, which are listed below.
+The camel.main supports 126 options, which are listed below.
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
@@ -134,8 +134,9 @@ The camel.main supports 125 options, which are listed below.
 | *camel.main.streamCachingSpool{zwsp}Cipher* | Sets a stream caching cipher 
name to use when spooling to disk to write with encryption. By default the data 
is not encrypted. |  | String
 | *camel.main.streamCachingSpool{zwsp}Directory* | Sets the stream caching 
spool (temporary) directory to use for overflow and spooling to disk. If no 
spool directory has been explicit configured, then a temporary directory is 
created in the java.io.tmpdir directory. |  | String
 | *camel.main.streamCachingSpool{zwsp}Enabled* | To enable stream caching 
spooling to disk. This means, for large stream messages (over 128 KB by 
default) will be cached in a temporary file instead, and Camel will handle 
deleting the temporary file once the cached stream is no longer necessary. 
Default is false. | false | boolean
+| *camel.main.streamCachingSpool{zwsp}Rules* | Sets custom rules 
(org.apache.camel.spi.StreamCachingStrategy.SpoolRule) for deciding when to 
spool to disk. Multiple rules can be separated by comma. |  | String
 | *camel.main.streamCachingSpool{zwsp}Threshold* | Stream caching threshold in 
bytes when overflow to disk is activated. The default threshold is 128kb. Use 
-1 to disable overflow to disk. |  | long
-| *camel.main.streamCachingSpool{zwsp}UsedHeapMemoryLimit* | Sets what the 
upper bounds should be when streamCachingSpoolUsedHeapMemoryThreshold is in 
use. |  | String
+| *camel.main.streamCachingSpool{zwsp}UsedHeapMemoryLimit* | Sets what the 
upper bounds should be when streamCachingSpoolUsedHeapMemoryThreshold is in 
use. | Max | String
 | *camel.main.streamCachingSpool{zwsp}UsedHeapMemoryThreshold* | Sets a 
percentage (1-99) of used heap memory threshold to activate stream caching 
spooling to disk. |  | int
 | *camel.main.streamCaching{zwsp}StatisticsEnabled* | Sets whether stream 
caching statistics is enabled. | false | boolean
 | *camel.main.threadNamePattern* | Sets the thread name pattern used for 
creating the full thread name. The default pattern is: Camel (#camelId#) thread 
##counter# - #name# Where #camelId# is the name of the CamelContext. and 
#counter# is a unique incrementing counter. and #name# is the regular thread 
name. You can also use #longName# which is the long thread name which can 
includes endpoint parameters etc. |  | String
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
index 7ee837ca6ca7..6a1114654732 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
@@ -90,6 +90,7 @@ import org.apache.camel.spi.ThreadPoolProfile;
 import org.apache.camel.spi.UnitOfWorkFactory;
 import org.apache.camel.spi.UuidGenerator;
 import org.apache.camel.spi.VariableRepositoryFactory;
+import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.support.ClassicUuidGenerator;
 import org.apache.camel.support.DefaultContextReloadStrategy;
 import org.apache.camel.support.DefaultUuidGenerator;
@@ -238,6 +239,13 @@ public final class DefaultConfigurationConfigurer {
             camelContext.getStreamCachingStrategy()
                     
.setSpoolUsedHeapMemoryThreshold(config.getStreamCachingSpoolUsedHeapMemoryThreshold());
         }
+        if (config.getStreamCachingSpoolRules() != null) {
+            for (String ref : config.getStreamCachingSpoolRules().split(",")) {
+                var custom
+                        = CamelContextHelper.mandatoryLookup(camelContext, 
ref.trim(), StreamCachingStrategy.SpoolRule.class);
+                camelContext.getStreamCachingStrategy().addSpoolRule(custom);
+            }
+        }
 
         if ("default".equals(config.getUuidGenerator())) {
             camelContext.setUuidGenerator(new DefaultUuidGenerator());
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index 259ff1cfc966..ff8a5923b22c 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -66,8 +66,11 @@ public abstract class DefaultConfigurationProperties<T> {
     private String streamCachingSpoolCipher;
     private long streamCachingSpoolThreshold;
     private int streamCachingSpoolUsedHeapMemoryThreshold;
+    @Metadata(defaultValue = "Max", enums = "Committed,Max")
     private String streamCachingSpoolUsedHeapMemoryLimit;
     private boolean streamCachingAnySpoolRules;
+    @Metadata(label = "advanced")
+    private String streamCachingSpoolRules;
     private int streamCachingBufferSize;
     private boolean streamCachingRemoveSpoolDirectoryWhenStopping = true;
     private boolean streamCachingStatisticsEnabled;
@@ -584,6 +587,18 @@ public abstract class DefaultConfigurationProperties<T> {
         this.streamCachingAnySpoolRules = streamCachingAnySpoolRules;
     }
 
+    public String getStreamCachingSpoolRules() {
+        return streamCachingSpoolRules;
+    }
+
+    /**
+     * Sets custom rules 
(org.apache.camel.spi.StreamCachingStrategy.SpoolRule) for deciding when to 
spool to disk.
+     * Multiple rules can be separated by comma.
+     */
+    public void setStreamCachingSpoolRules(String streamCachingSpoolRules) {
+        this.streamCachingSpoolRules = streamCachingSpoolRules;
+    }
+
     public int getStreamCachingBufferSize() {
         return streamCachingBufferSize;
     }
@@ -1999,6 +2014,15 @@ public abstract class DefaultConfigurationProperties<T> {
         return (T) this;
     }
 
+    /**
+     * Sets custom rules 
(org.apache.camel.spi.StreamCachingStrategy.SpoolRule) for deciding when to 
spool to disk.
+     * Multiple rules can be separated by comma.
+     */
+    public T withStreamCachingAnySpoolRules(String streamCachingSpoolRules) {
+        this.streamCachingSpoolRules = streamCachingSpoolRules;
+        return (T) this;
+    }
+
     /**
      * Sets the stream caching buffer size to use when allocating in-memory 
buffers used for in-memory stream caches.
      *
diff --git a/docs/user-manual/modules/ROOT/pages/stream-caching.adoc 
b/docs/user-manual/modules/ROOT/pages/stream-caching.adoc
index 161eb0b44ec2..c3f3fc5d525c 100644
--- a/docs/user-manual/modules/ROOT/pages/stream-caching.adoc
+++ b/docs/user-manual/modules/ROOT/pages/stream-caching.adoc
@@ -102,6 +102,11 @@ context.setStreamCaching(true);
 
 or on routes:
 
+[tabs]
+====
+
+Java::
++
 [source,java]
 ----
 from("file:inbox")
@@ -109,6 +114,30 @@ from("file:inbox")
   .to("bean:foo");
 ----
 
+XML::
++
+[source,xml]
+----
+<route streamCache="true">
+    <from uri="file:inbox"/>
+    <to uri="bean:foo"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+    streamCache: "true"
+    from:
+      uri: file:inbox
+      steps:
+        - to:
+            uri: bean:foo
+----
+====
+
 == Configuring Stream Caching using Application Properties
 
 When using Spring Boot, Quarkus or Camel Standalone It's recommended to 
configure stream caching in the `application.properties` configuration file:
@@ -143,43 +172,108 @@ In xref:spring-xml-extensions.adoc[Spring XML] you can 
enable stream caching on
 </camelContext>
 ----
 
-=== Using spoolUsedHeapMemoryThreshold
+== Using spoolUsedHeapMemoryThreshold
 
 By default, stream caching will spool only big payloads (128 KB or bigger) to 
disk. However you can also set the `spoolUsedHeapMemoryThreshold` option which 
is a percentage of used heap memory. This can be used to also spool to disk 
when running low on memory.
 
 For example with:
 
+[tabs]
+====
+
+Spring XML::
++
 [source,xml]
 ----
 <streamCaching id="myCacheConfig" spoolEnabled="true" 
spoolDirectory="/tmp/cachedir" spoolUsedHeapMemoryThreshold="70"/>
 ----
 
+Application Properties::
++
+[source,properties]
+----
+camel.main.streamCachingSpoolEnabled = true
+camel.main.streamCachingSpoolDirectory = /tmp/cachedir
+camel.main.streamCachingSpoolUsedHeapMemoryThreshold = 70
+----
+====
+
 Then notice that as `spoolThreshold` is default enabled with 128 KB, then we 
have both thresholds in use (`spoolThreshold` and 
`spoolUsedHeapMemoryThreshold`). And in this example then we only spool to disk 
if payload is > 128 KB and that used heap memory is > 70%. The reason is that 
we have the option `anySpoolRules` as default `false`. That means both rules 
must be `true` (e.g. AND).
 
 If we want to spool to disk if either of the rules (e.g. OR), then we can do:
 
+[tabs]
+====
+
+Spring XML::
++
 [source,xml]
 ----
 <streamCaching id="myCacheConfig" spoolEnabled="true" 
spoolDirectory="/tmp/cachedir" spoolUsedHeapMemoryThreshold="70" 
anySpoolRules="true"/>
 ----
 
+Application Properties::
++
+[source,properties]
+----
+camel.main.streamCachingSpoolEnabled = true
+camel.main.streamCachingSpoolDirectory = /tmp/cachedir
+camel.main.streamCachingSpoolUsedHeapMemoryThreshold = 70
+camel.main.streamCachingAnySpoolRules = true
+----
+====
+
+
 If we only want to spool to disk if we run low on memory then we can set:
 
+[tabs]
+====
+
+Spring XML::
++
 [source,xml]
 ----
 <streamCaching id="myCacheConfig" spoolEnabled="true" 
spoolDirectory="/tmp/cachedir" spoolThreshold="-1" 
spoolUsedHeapMemoryThreshold="70"/>
 ----
 
+Application Properties::
++
+[source,properties]
+----
+camel.main.streamCachingSpoolEnabled = true
+camel.main.streamCachingSpoolDirectory = /tmp/cachedir
+camel.main.streamCachingSpoolThreshold = -1
+camel.main.streamCachingSpoolUsedHeapMemoryThreshold = 70
+----
+====
+
 then we do not use the `spoolThreshold` rule, and only the heap memory based 
is in use.
 
 By default, the upper limit of the used heap memory is based on the maximum 
heap size. Though you can also configure to use the committed heap size as the 
upper limit, this is done using the `spoolUsedHeapMemoryLimit` option as shown 
below:
 
+[tabs]
+====
+
+Spring XML::
++
 [source,xml]
 ----
 <streamCaching id="myCacheConfig" spoolEnabled="true" 
spoolDirectory="/tmp/cachedir" spoolUsedHeapMemoryThreshold="70" 
spoolUsedHeapMemoryLimit="Committed"/>
 ----
 
-== Using custom SpoolRule implementations
+Application Properties::
++
+[source,properties]
+----
+camel.main.streamCachingSpoolEnabled = true
+camel.main.streamCachingSpoolDirectory = /tmp/cachedir
+camel.main.streamCachingSpoolUsedHeapMemoryThreshold = 70
+camel.main.streamCachingSpoolUsedHeapMemoryLimit = Committed
+----
+
+====
+
+== Using custom SpoolRule implementations (advanced)
 
 You can implement your custom rules to determine if the stream should be 
spooled to disk. This can be done by implementing the interface 
`org.apache.camel.spi.StreamCachingStrategy.SpoolRule` which has a single 
method:
 
@@ -191,31 +285,52 @@ boolean shouldSpoolCache(long length);
 The `length` is the length of the stream.
 To use the rule then add it to the `StreamCachingStrategy` as shown below:
 
+[tabs]
+====
+
+Java::
++
 [source,java]
 ----
 SpoolRule mySpoolRule = ...
 context.getStreamCachingStrategy().addSpoolRule(mySpoolRule);
 ----
 
-And from XML you need to define a `<bean>` with your custom rule:
-
+Spring XML::
++
+And from Spring XML you need to define a `<bean>` with your custom rule:
++
 [source,xml]
 ----
 <bean id="mySpoolRule" class="com.foo.MySpoolRule"/>
 
 <streamCaching id="myCacheConfig" spoolEnabled="true" 
spoolDirectory="/tmp/cachedir" spoolRules="mySpoolRule"/>
 ----
-
++
 Using the spoolRules attribute on `<streamCaching>`. if you have more rules, 
then separate them by comma.
-
++
 [source,xml]
 ----
 <streamCaching id="myCacheConfig" spoolEnabled="true" 
spoolDirectory="/tmp/cachedir" spoolRules="mySpoolRule,myOtherSpoolRule"/>
 ----
 
+Application Properties::
++
+When using Spring Boot or Camel Standalone you can also configure in 
`application.properties`:
++
+[source,properties]
+----
+# refers to the bean id of the rule object
+camel.main.streamCachingSpoolRules=mySpoolRule
+# you can also specify the class via
+camel.main.streamCachingSpoolRules=#class:com.foo.MySpoolRule
+----
+====
+
+
 == Using StreamCachingProcessor
 
-Since Camel 4.11 this processor can be used to convert the current message 
body to a `StreamCache`. This allows the body to be re-read multiple times and 
can be placed at any point in a Camel route.
+Since *Camel 4.11* this processor can be used to convert the current message 
body to a `StreamCache`. This allows the body to be re-read multiple times and 
can be placed at any point in a Camel route.
 
 [source, java]
 ----

Reply via email to