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


The following commit(s) were added to refs/heads/main by this push:
     new 9f0f6a581 chore: remove the split option of ogcapi-features-action 
(#3320)
9f0f6a581 is described below

commit 9f0f6a58191d5599a2f77349787cfabb42b562c4
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Nov 21 13:58:12 2026 +0100

    chore: remove the split option of ogcapi-features-action (#3320)
    
    split did nothing when the Kamelet was called with to, as in a Pipe:
    kamelet:sink has no consumer there, so the next step got the whole
    feature collection anyway. It only worked inside a Kamelet EIP. The
    option and the camel:jsonpath dependency it needed are removed. The
    description says to add a split step on $.features[*] after the
    Kamelet, and the new ogcapi-features-action-split-route test does that.
    
    
    Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../camel-kamelets-catalog-sbom.json               |  2 +-
 kamelets/ogcapi-features-action.kamelet.yaml       | 29 +-------
 .../main/resources/META-INF/kamelets-index.json    |  2 +-
 .../kamelets/ogcapi-features-action.kamelet.yaml   | 29 +-------
 ...capi-features-action-split-route.citrus.it.yaml | 82 ++++++++++++++++++++++
 .../geo/ogcapi-features-action-split-route.yaml    | 43 ++++++++++++
 6 files changed, 133 insertions(+), 54 deletions(-)

diff --git a/camel-kamelets-sbom/camel-kamelets-catalog-sbom.json 
b/camel-kamelets-sbom/camel-kamelets-catalog-sbom.json
index 5e5c3fe40..eaef6339c 100644
--- a/camel-kamelets-sbom/camel-kamelets-catalog-sbom.json
+++ b/camel-kamelets-sbom/camel-kamelets-catalog-sbom.json
@@ -2734,7 +2734,7 @@
     "dependsOn" : [ 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]" ]
   }, {
     "ref" : "kamelet:ogcapi-features-action",
-    "dependsOn" : [ "pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]" ]
+    "dependsOn" : [ "pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]" ]
   }, {
     "ref" : "kamelet:opensearch-index-sink",
     "dependsOn" : [ "pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]", 
"pkg:maven/org.apache.camel/[email protected]" ]
diff --git a/kamelets/ogcapi-features-action.kamelet.yaml 
b/kamelets/ogcapi-features-action.kamelet.yaml
index 087f36016..799debf44 100644
--- a/kamelets/ogcapi-features-action.kamelet.yaml
+++ b/kamelets/ogcapi-features-action.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
 
       Output: the body is a GeoJSON feature collection, as JSON text in bytes, 
with at most `limit` features. The headers of the HTTP response, such as 
`Content-Type`, are set as headers.
 
-      Good to know: `split` gives each feature as a message of its own, as 
JSON text in bytes with the `Content-Type` `application/json`, only when the 
Kamelet is called with the `kamelet` EIP. Called with `to`, as in a Pipe, the 
next step still gets the whole collection, once per message, as text. An HTTP 
error from the server, such as an unknown collection, fails the message. 
Headers that start with `CamelHttp` or `CamelRestHttp` are removed from the 
message first, so they cannot chang [...]
+      Good to know: to handle each feature as a message of its own, add a 
`split` step after the Kamelet with the JSONPath `$.features[*]`. An HTTP error 
from the server, such as an unknown collection, fails the message. Headers that 
start with `CamelHttp` or `CamelRestHttp` are removed from the message first, 
so they cannot change what the Kamelet does. The login comes only from the 
options: an `Authorization` or `Proxy-Authorization` header on the message is 
removed, so a credential th [...]
     required:
       - url
       - collection
@@ -68,11 +68,6 @@ spec:
         description: "The largest number of features to read for each message, 
between 1 and 10000."
         type: integer
         default: 10
-      split:
-        title: "Split by Feature"
-        description: "Gives each feature as a message of its own when the 
Kamelet is called with the `kamelet` EIP. Called with `to`, as in a Pipe, it 
does not change what the next step receives: the whole feature collection."
-        type: boolean
-        default: false
       query:
         title: "Query"
         description: "More query parameters for every request, in the form 
`name=value`, separated by `&`, such as filters on the properties of the 
features that the service supports."
@@ -170,7 +165,6 @@ spec:
   dependencies:
     - "camel:http"
     - "camel:kamelet"
-    - "camel:jsonpath"
     - "camel:jackson3"
   template:
     from:
@@ -215,25 +209,8 @@ spec:
             name: CamelHttpQuery
         - convertBodyTo:
             type: java.lang.String
-        - choice:
-            when:
-              - expression:
-                  simple:
-                    expression: "{{split}}"
-                steps:
-                  - split:
-                      expression:
-                        jsonpath:
-                          expression: "$.features[*]"
-                      steps:
-                        - marshal:
-                            json: {}
-                        - to:
-                            uri: kamelet:sink
-            otherwise:
-              steps:
-                - to:
-                    uri: kamelet:sink
+        - to:
+            uri: kamelet:sink
 
 
 
diff --git 
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json 
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index 36eabb9fd..695017ba6 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -1575,7 +1575,7 @@
     "supportLevel" : "Stable",
     "title" : "OGC Api Feature Get Item Action",
     "summary" : "Fetches the features of one collection, such as the lakes or 
the buildings of an area, from a server that implements the OGC API Features 
standard, and gives them as GeoJSON.",
-    "description" : "Fetches the features of one collection, such as the lakes 
or the buildings of an area, from a server that implements the OGC API Features 
standard, and gives them as GeoJSON.\n\nUse it to bring map data from a 
geographic data service into a flow, for example to load the features of an 
area into a database or to check them against a list of places.\n\nInput: the 
body, when it is not empty, is added to the query of the request, as text such 
as `name=Lake Baikal`, so ea [...]
+    "description" : "Fetches the features of one collection, such as the lakes 
or the buildings of an area, from a server that implements the OGC API Features 
standard, and gives them as GeoJSON.\n\nUse it to bring map data from a 
geographic data service into a flow, for example to load the features of an 
area into a database or to check them against a list of places.\n\nInput: the 
body, when it is not empty, is added to the query of the request, as text such 
as `name=Lake Baikal`, so ea [...]
     "group" : "Geospatial",
     "namespace" : "Geo",
     "provider" : "Apache Software Foundation"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
index 087f36016..799debf44 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
 
       Output: the body is a GeoJSON feature collection, as JSON text in bytes, 
with at most `limit` features. The headers of the HTTP response, such as 
`Content-Type`, are set as headers.
 
-      Good to know: `split` gives each feature as a message of its own, as 
JSON text in bytes with the `Content-Type` `application/json`, only when the 
Kamelet is called with the `kamelet` EIP. Called with `to`, as in a Pipe, the 
next step still gets the whole collection, once per message, as text. An HTTP 
error from the server, such as an unknown collection, fails the message. 
Headers that start with `CamelHttp` or `CamelRestHttp` are removed from the 
message first, so they cannot chang [...]
+      Good to know: to handle each feature as a message of its own, add a 
`split` step after the Kamelet with the JSONPath `$.features[*]`. An HTTP error 
from the server, such as an unknown collection, fails the message. Headers that 
start with `CamelHttp` or `CamelRestHttp` are removed from the message first, 
so they cannot change what the Kamelet does. The login comes only from the 
options: an `Authorization` or `Proxy-Authorization` header on the message is 
removed, so a credential th [...]
     required:
       - url
       - collection
@@ -68,11 +68,6 @@ spec:
         description: "The largest number of features to read for each message, 
between 1 and 10000."
         type: integer
         default: 10
-      split:
-        title: "Split by Feature"
-        description: "Gives each feature as a message of its own when the 
Kamelet is called with the `kamelet` EIP. Called with `to`, as in a Pipe, it 
does not change what the next step receives: the whole feature collection."
-        type: boolean
-        default: false
       query:
         title: "Query"
         description: "More query parameters for every request, in the form 
`name=value`, separated by `&`, such as filters on the properties of the 
features that the service supports."
@@ -170,7 +165,6 @@ spec:
   dependencies:
     - "camel:http"
     - "camel:kamelet"
-    - "camel:jsonpath"
     - "camel:jackson3"
   template:
     from:
@@ -215,25 +209,8 @@ spec:
             name: CamelHttpQuery
         - convertBodyTo:
             type: java.lang.String
-        - choice:
-            when:
-              - expression:
-                  simple:
-                    expression: "{{split}}"
-                steps:
-                  - split:
-                      expression:
-                        jsonpath:
-                          expression: "$.features[*]"
-                      steps:
-                        - marshal:
-                            json: {}
-                        - to:
-                            uri: kamelet:sink
-            otherwise:
-              steps:
-                - to:
-                    uri: kamelet:sink
+        - to:
+            uri: kamelet:sink
 
 
 
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/geo/ogcapi-features-action-split-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/geo/ogcapi-features-action-split-route.citrus.it.yaml
new file mode 100644
index 000000000..f85ff3aa7
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/geo/ogcapi-features-action-split-route.citrus.it.yaml
@@ -0,0 +1,82 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+name: ogcapi-features-action-split-route-test
+description: 'A split step on $.features[*] after ogcapi-features-action gives 
each feature of the collection as a message of its own'
+actions:
+  - camel:
+      cli:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "geo/ogcapi-features-action-split-route.yaml"
+            systemProperties:
+              properties:
+                - name: "http.sink.url"
+                  value: "http://localhost:${http.server.port}";
+                - name: "http.server.port"
+                  value: "${http.server.port}"
+
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        GET:
+          path: "/collections/lakes/items"
+
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+          headers:
+            - name: "Content-Type"
+              value: "application/geo+json"
+          body:
+            data: 
'{"type":"FeatureCollection","features":[{"type":"Feature","id":"1","properties":{"name":"Lake
 
Baikal"},"geometry":{"type":"Point","coordinates":[108.0,53.5]}},{"type":"Feature","id":"2","properties":{"name":"Lake
 Tanganyika"},"geometry":{"type":"Point","coordinates":[29.5,-6.0]}}]}'
+
+  # each feature arrives as a message of its own
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        POST:
+          path: "/feature"
+          body:
+            data: '{"type":"Feature","id":"1","properties":{"name":"Lake 
Baikal"},"geometry":{"type":"Point","coordinates":[108.0,53.5]}}'
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        POST:
+          path: "/feature"
+          body:
+            data: '{"type":"Feature","id":"2","properties":{"name":"Lake 
Tanganyika"},"geometry":{"type":"Point","coordinates":[29.5,-6.0]}}'
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/geo/ogcapi-features-action-split-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/geo/ogcapi-features-action-split-route.yaml
new file mode 100644
index 000000000..ca65b494f
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/geo/ogcapi-features-action-split-route.yaml
@@ -0,0 +1,43 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+# To handle each feature as a message of its own: a split step after the 
Kamelet
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "1000"
+        repeatCount: 1
+      steps:
+        - setBody:
+            constant: ''
+        - to:
+            uri: "kamelet:ogcapi-features-action"
+            parameters:
+              url: 'http://localhost:{{http.server.port}}'
+              collection: 'lakes'
+              limit: '2'
+        - split:
+            expression:
+              jsonpath:
+                expression: "$.features[*]"
+            steps:
+              # each feature is a Map: turn it into JSON text
+              - marshal:
+                  json: {}
+              - to:
+                  uri: "{{http.sink.url}}/feature"

Reply via email to