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

acosentino pushed a commit to branch value-to-key
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 56366cd1efa3596900527a27a978a6c38fb72508
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed May 5 12:11:47 2021 +0200

    Added Value To Key Action to Catalog
---
 .../kamelets/value-to-key-action.kamelet.yaml      | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git 
a/library/camel-kamelets-catalog/src/main/resources/kamelets/value-to-key-action.kamelet.yaml
 
b/library/camel-kamelets-catalog/src/main/resources/kamelets/value-to-key-action.kamelet.yaml
new file mode 100644
index 0000000..bf3cf83
--- /dev/null
+++ 
b/library/camel-kamelets-catalog/src/main/resources/kamelets/value-to-key-action.kamelet.yaml
@@ -0,0 +1,42 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: value-to-key-action
+  labels:
+    camel.apache.org/kamelet.type: "action"
+  annotations:
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+spec:
+  definition:
+    title: "Value to Key action"
+    description: "Replace the Kafka record key with a new key formed from a 
subset of fields in the body"
+    required:
+      - fields
+    properties:
+      fields:
+        title: Fields
+        description: Comma separated list of fields to be used to form the new 
key
+        type: string
+    type: object
+  dependencies:
+  - github:apache.camel-kamelets:camel-kamelets-utils:main-SNAPSHOT
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+      - choice:
+          when:
+          - simple: "${header[Content-Type]} == 'application/json'"
+            steps:
+            - unmarshal:
+                json: {}
+      - set-property:
+          name: "fields"
+          constant: "{{fields}}"
+      - bean: "org.apache.camel.kamelets.utils.transform.kafka.ValueToKey"
+      - marshal:
+          json: {}
+      - set-header:
+          name: "Content-Type"
+          constant: "application/json"

Reply via email to