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

oscerd 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 2468fbcc7000 CAMEL-24755: camel-sql-stored - align the resource 
schemes in the CAMEL-24292 upgrade-guide entry (#26470)
2468fbcc7000 is described below

commit 2468fbcc7000838930bba7ac92ff124e84a760a9
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Sep 15 14:20:50 2026 +0200

    CAMEL-24755: camel-sql-stored - align the resource schemes in the 
CAMEL-24292 upgrade-guide entry (#26470)
    
    Aligns the resource schemes named in the sql-stored allowTemplateFromHeader 
@UriParam description with the
    CAMEL-24292 upgrade-guide entry (file:/http:/classpath:), and regenerates 
the catalog/endpoint DSL metadata.
    
    Co-authored-by: Claude Opus 4.8 <[email protected]>
---
 .../org/apache/camel/catalog/components/sql-stored.json       |  2 +-
 .../org/apache/camel/component/sql/stored/sql-stored.json     |  2 +-
 .../apache/camel/component/sql/stored/SqlStoredEndpoint.java  |  3 ++-
 .../modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc       | 11 +++++++++--
 .../builder/endpoint/dsl/SqlStoredEndpointBuilderFactory.java |  4 ++--
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sql-stored.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sql-stored.json
index cf3f69b6ce36..c8ffd08ff1ea 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sql-stored.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sql-stored.json
@@ -45,6 +45,6 @@
     "useMessageBodyForTemplate": { "index": 6, "kind": "parameter", 
"displayName": "Use Message Body For Template", "group": "producer", "label": 
"", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Whether to use the message body as the stored procedure 
template and then headers for parameters. If this option is enabled then the 
template in the uri is not used." },
     "lazyStartProducer": { "index": 7, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a produc [...]
     "templateOptions": { "index": 8, "kind": "parameter", "displayName": 
"Template Options", "group": "advanced", "label": "advanced", "required": 
false, "type": "object", "javaType": "java.util.Map<java.lang.String, 
java.lang.Object>", "prefix": "template.", "multiValue": true, "deprecated": 
false, "autowired": false, "secret": false, "description": "Configures the 
Spring JdbcTemplate with the key\/values from the Map. This is a multi-value 
option with prefix: template." },
-    "allowTemplateFromHeader": { "index": 9, "kind": "parameter", 
"displayName": "Allow Template From Header", "group": "security", "label": 
"security", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:dev", "insecureValue": "true", "defaultValue": false, "description": 
"Whether to allow overriding the endpoint-configured stored-procedure template 
with the CamelSqlStoredTemplate header. Disabled b [...]
+    "allowTemplateFromHeader": { "index": 9, "kind": "parameter", 
"displayName": "Allow Template From Header", "group": "security", "label": 
"security", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:dev", "insecureValue": "true", "defaultValue": false, "description": 
"Whether to allow overriding the endpoint-configured stored-procedure template 
with the CamelSqlStoredTemplate header. Disabled b [...]
   }
 }
diff --git 
a/components/camel-sql/src/generated/resources/META-INF/org/apache/camel/component/sql/stored/sql-stored.json
 
b/components/camel-sql/src/generated/resources/META-INF/org/apache/camel/component/sql/stored/sql-stored.json
index cf3f69b6ce36..c8ffd08ff1ea 100644
--- 
a/components/camel-sql/src/generated/resources/META-INF/org/apache/camel/component/sql/stored/sql-stored.json
+++ 
b/components/camel-sql/src/generated/resources/META-INF/org/apache/camel/component/sql/stored/sql-stored.json
@@ -45,6 +45,6 @@
     "useMessageBodyForTemplate": { "index": 6, "kind": "parameter", 
"displayName": "Use Message Body For Template", "group": "producer", "label": 
"", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Whether to use the message body as the stored procedure 
template and then headers for parameters. If this option is enabled then the 
template in the uri is not used." },
     "lazyStartProducer": { "index": 7, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a produc [...]
     "templateOptions": { "index": 8, "kind": "parameter", "displayName": 
"Template Options", "group": "advanced", "label": "advanced", "required": 
false, "type": "object", "javaType": "java.util.Map<java.lang.String, 
java.lang.Object>", "prefix": "template.", "multiValue": true, "deprecated": 
false, "autowired": false, "secret": false, "description": "Configures the 
Spring JdbcTemplate with the key\/values from the Map. This is a multi-value 
option with prefix: template." },
-    "allowTemplateFromHeader": { "index": 9, "kind": "parameter", 
"displayName": "Allow Template From Header", "group": "security", "label": 
"security", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:dev", "insecureValue": "true", "defaultValue": false, "description": 
"Whether to allow overriding the endpoint-configured stored-procedure template 
with the CamelSqlStoredTemplate header. Disabled b [...]
+    "allowTemplateFromHeader": { "index": 9, "kind": "parameter", 
"displayName": "Allow Template From Header", "group": "security", "label": 
"security", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:dev", "insecureValue": "true", "defaultValue": false, "description": 
"Whether to allow overriding the endpoint-configured stored-procedure template 
with the CamelSqlStoredTemplate header. Disabled b [...]
   }
 }
diff --git 
a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java
 
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java
index 99f81e108bdc..2ded97421b56 100644
--- 
a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java
+++ 
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java
@@ -65,7 +65,8 @@ public class SqlStoredEndpoint extends DefaultEndpoint 
implements EndpointServic
     @UriParam(defaultValue = "false", label = "security", security = 
"insecure:dev", insecureValue = "true",
               description = "Whether to allow overriding the 
endpoint-configured stored-procedure template with the"
                             + " CamelSqlStoredTemplate header. Disabled by 
default; a header-supplied template is"
-                            + " resolved with placeholders only, never as a 
file:/http: resource.")
+                            + " resolved with placeholders only, never as a 
file:, http:, https: or classpath:"
+                            + " resource.")
     private boolean allowTemplateFromHeader;
     @UriParam(description = "If set, will ignore the results of the stored 
procedure template and use the existing IN message as the OUT message for the 
continuation of processing")
     private boolean noop;
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
index 9027544015e8..3df6c00f78bb 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
@@ -1997,17 +1997,24 @@ executed statement:
 
 * `camel-sql`: the `CamelSqlQuery` header replaced the endpoint query.
 * `camel-sql-stored`: the `CamelSqlStoredTemplate` header replaced the 
endpoint template, and its value was
-  resolved through `SqlHelper.resolveQuery`, which resolves `file:` / `http:` 
/ `classpath:` resources.
+  resolved through `SqlHelper.resolveQuery`, which resolves `file:`, `http:`, 
`https:` and `classpath:` resources.
 
 Both overrides are now disabled by default and must be opted into, matching 
the `allowTemplateFromHeader`
 convention already used by the template components (camel-freemarker, 
camel-velocity, camel-xslt, ...):
 
 * `camel-sql`: set `allowQueryFromHeader=true` to honour the `CamelSqlQuery` 
header again.
 * `camel-sql-stored`: set `allowTemplateFromHeader=true` to honour the 
`CamelSqlStoredTemplate` header again; a
-  header-supplied template is now resolved with property placeholders only, 
never as a `file:` / `http:` resource.
+  header-supplied template is now resolved with property placeholders only, 
never as a `file:`, `http:`, `https:`
+  or `classpath:` resource.
 
 A route that relied on either header must set the corresponding option on the 
endpoint.
 
+Opting back in is not quite the previous behaviour. `SqlHelper.resolveQuery` 
applied placeholder resolution only to
+a value that had a scheme, so a schemeless header template used to reach the 
database untouched; it now always goes
+through `SqlHelper.resolvePlaceholders`, which drops `--` comment lines and 
blank lines and re-joins the rest with
+newlines. That is immaterial for the single-line call syntax a 
stored-procedure template normally uses, but a route
+passing a multi-line commented template through the header will see the 
comments stripped.
+
 Additionally, `camel-sql-stored` with `useMessageBodyForTemplate=true` now 
uses the message body verbatim as the
 stored-procedure template text and no longer resolves it through 
`SqlHelper.resolveQuery`. A body beginning with
 `file:`, `http:`, `https:` or `classpath:` is therefore treated as literal 
template text instead of being fetched
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SqlStoredEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SqlStoredEndpointBuilderFactory.java
index 1dc31b485fb4..5378273bcbea 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SqlStoredEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SqlStoredEndpointBuilderFactory.java
@@ -224,7 +224,7 @@ public interface SqlStoredEndpointBuilderFactory {
          * Whether to allow overriding the endpoint-configured stored-procedure
          * template with the CamelSqlStoredTemplate header. Disabled by 
default;
          * a header-supplied template is resolved with placeholders only, never
-         * as a file:/http: resource.
+         * as a file:, http:, https: or classpath: resource.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -242,7 +242,7 @@ public interface SqlStoredEndpointBuilderFactory {
          * Whether to allow overriding the endpoint-configured stored-procedure
          * template with the CamelSqlStoredTemplate header. Disabled by 
default;
          * a header-supplied template is resolved with placeholders only, never
-         * as a file:/http: resource.
+         * as a file:, http:, https: or classpath: resource.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 

Reply via email to