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-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new e21316e6f Fix #930: salesforce-delete/update-sink: use 
CamelSalesforceSObjectId and canonical YAML DSL (#3076)
e21316e6f is described below

commit e21316e6fc2c59f02eb87fe0799609df92b6506d
Author: Salvatore Mongiardo <[email protected]>
AuthorDate: Thu Oct 1 16:28:09 2026 +0200

    Fix #930: salesforce-delete/update-sink: use CamelSalesforceSObjectId and 
canonical YAML DSL (#3076)
    
    Two bugs fixed in both salesforce sink kamelets:
    
    1. Wrong header name: CamelSalesforceId → CamelSalesforceSObjectId
       SalesforceEndpointConfig.SOBJECT_ID = "CamelSalesforceSObjectId", so the
       component's AbstractRestProcessor.determineSObjectId() looks for that 
header.
       Using CamelSalesforceId leaves it unset, causing:
         - salesforce-delete-sink: "Missing property CamelSalesforceSObjectId"
         - salesforce-update-sink: URISyntaxException — the full JSON body is
           appended to the URL as the record ID instead of the sObject ID
    
    2. Compact YAML DSL notation deprecated since Camel 4.4:
       The shorthand form setHeader.jsonpath / transform.jsonpath silently fails
       to wire the expression at runtime. Converted to canonical form:
    
         - setHeader:
             name: CamelSalesforceSObjectId
             expression:
               jsonpath:
                 expression: "$.sObjectId"
    
       Same for the transform step in salesforce-update-sink.
    
    Also corrected the removeHeader names in salesforce-update-sink from the
    raw field names (sObjectId / sObjectName) to the actual Camel header names
    (CamelSalesforceSObjectId / CamelSalesforceSObjectName).
    
    Co-authored-by: Claude Sonnet 4.6 (1M context) <[email protected]>
---
 kamelets/salesforce-delete-sink.kamelet.yaml | 12 ++++++++----
 kamelets/salesforce-update-sink.kamelet.yaml | 18 ++++++++++++------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/kamelets/salesforce-delete-sink.kamelet.yaml 
b/kamelets/salesforce-delete-sink.kamelet.yaml
index 4fb7171e5..12edc591b 100644
--- a/kamelets/salesforce-delete-sink.kamelet.yaml
+++ b/kamelets/salesforce-delete-sink.kamelet.yaml
@@ -133,16 +133,20 @@ spec:
       uri: kamelet:source
       steps:
         - setHeader:
-            name: CamelSalesforceId
-            jsonpath: "$['sObjectId']"
+            name: CamelSalesforceSObjectId
+            expression:
+              jsonpath:
+                expression: "$['sObjectId']"
         - setHeader:
             name: CamelSalesforceSObjectName
-            jsonpath: "$['sObjectName']"
+            expression:
+              jsonpath:
+                expression: "$['sObjectName']"
         - setBody:
             simple: "${null}"
         - to:
             uri: "{{local-delete-salesforce}}:deleteSObject"
         - removeHeader:
-            name: CamelSalesforceId
+            name: CamelSalesforceSObjectId
         - removeHeader:
             name: CamelSalesforceSObjectName
diff --git a/kamelets/salesforce-update-sink.kamelet.yaml 
b/kamelets/salesforce-update-sink.kamelet.yaml
index 4e70b330c..a0329e9de 100644
--- a/kamelets/salesforce-update-sink.kamelet.yaml
+++ b/kamelets/salesforce-update-sink.kamelet.yaml
@@ -127,13 +127,19 @@ spec:
       uri: kamelet:source
       steps:
         - setHeader:
-            name: CamelSalesforceId
-            jsonpath: "$.sObjectId"
+            name: CamelSalesforceSObjectId
+            expression:
+              jsonpath:
+                expression: "$.sObjectId"
         - setHeader:
             name: CamelSalesforceSObjectName
-            jsonpath: "$.sObjectName"
+            expression:
+              jsonpath:
+                expression: "$.sObjectName"
         - transform:
-            jsonpath: "$.payload"
+            expression:
+              jsonpath:
+                expression: "$.payload"
         - marshal:
             json: {}
         - to:
@@ -141,6 +147,6 @@ spec:
             parameters:
               rawPayload: "true"
         - removeHeader:
-            name: sObjectId
+            name: CamelSalesforceSObjectId
         - removeHeader:
-            name: sObjectName
+            name: CamelSalesforceSObjectName

Reply via email to