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

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new c71cf67  Add Kamelet examples for Designer
     new e926cb6  Merge pull request #1 from mgubaidullin/kamelet-examples
c71cf67 is described below

commit c71cf678715a821438f5df89ba5c9fa135579c12
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Wed Oct 6 18:11:16 2021 -0400

    Add Kamelet examples for Designer
---
 .../public/kamelets/http-secured-sink.kamelet.yaml | 69 +++++++++++++++
 .../kamelets/http-secured-source.kamelet.yaml      | 79 +++++++++++++++++
 .../public/kamelets/http-sink.kamelet.yaml         | 43 ++++++++++
 .../public/kamelets/http-source.kamelet.yaml       | 53 ++++++++++++
 .../kamelets/insert-field-action.kamelet.yaml      | 67 +++++++++++++++
 .../kamelets/insert-header-action.kamelet.yaml     | 40 +++++++++
 .../kamelets/kafka-not-secured-sink.kamelet.yaml   | 73 ++++++++++++++++
 .../kamelets/kafka-not-secured-source.kamelet.yaml | 68 +++++++++++++++
 .../public/kamelets/kafka-sink.kamelet.yaml        | 99 ++++++++++++++++++++++
 .../public/kamelets/kafka-source.kamelet.yaml      | 94 ++++++++++++++++++++
 10 files changed, 685 insertions(+)

diff --git a/karavan-designer/public/kamelets/http-secured-sink.kamelet.yaml 
b/karavan-designer/public/kamelets/http-secured-sink.kamelet.yaml
new file mode 100644
index 0000000..1943c0f
--- /dev/null
+++ b/karavan-designer/public/kamelets/http-secured-sink.kamelet.yaml
@@ -0,0 +1,69 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: http-secured-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMC
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "HTTP"
+  labels:
+    camel.apache.org/kamelet.type: sink
+spec:
+  definition:
+    title: Secured HTTP Sink
+    description: Forwards an event to a secured HTTP endpoint
+    required:
+    - url
+    type: object
+    properties:
+      url:
+        title: URL
+        description: The URL to send data to
+        type: string
+        example: "https://my-service/path";
+        pattern: "^(http|https)://.*"
+      method:
+        title: Method
+        description: The HTTP method to use
+        type: string
+        default: POST
+      authMethod:
+        title: Authentication Method
+        description: Authentication methods allowed to use as a comma 
separated list of values Basic, Digest or NTLM.
+        type: string
+        default: "Basic"
+      authenticationPreemptive:
+        title: Authentication Preemptive
+        description: If this option is true, camel-http sends preemptive basic 
authentication to the server.
+        type: boolean
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        default: false
+      authUsername:
+        title: Authentication Username
+        description: Authentication username
+        type: string
+      authPassword:
+        title: Authentication Password
+        description: Authentication password
+        type: string
+  dependencies:
+  - "camel:http"
+  - "camel:kamelet"
+  - "camel:core"
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+      - set-header:
+          name: CamelHttpMethod
+          constant: "{{method}}"
+      - to:
+          uri: "{{url}}"
+          parameters: 
+            authMethod: "{{authMethod}}"
+            authUsername: "{{authUsername}}"
+            authPassword: "{{authPassword}}"
+            authenticationPreemptive: "{{authenticationPreemptive}}"
diff --git a/karavan-designer/public/kamelets/http-secured-source.kamelet.yaml 
b/karavan-designer/public/kamelets/http-secured-source.kamelet.yaml
new file mode 100644
index 0000000..98e950c
--- /dev/null
+++ b/karavan-designer/public/kamelets/http-secured-source.kamelet.yaml
@@ -0,0 +1,79 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: http-secured-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMC
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "HTTP"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "HTTP Secured Source"
+    description: |-
+      Periodically fetches a secured HTTP resource and provides the content as 
output.
+    required:
+    - url
+    type: object
+    properties:
+      period:
+        title: Period between Updates
+        description: The interval between fetches in milliseconds
+        type: integer
+        default: 10000
+      contentType:
+        title: Content Type
+        description: The content type accepted for the resource
+        type: string
+        default: "application/json"
+      url:
+        title: URL
+        description: The URL to fetch for data
+        type: string
+        example: 
"https://gist.githubusercontent.com/nicolaferraro/e3c72ace3c751f9f88273896611ce5fe/raw/3b6f54060bacb56b6719b7386a4645cb59ad6cc1/quote.json";
+        pattern: "^(http|https)://.*"
+      authMethod:
+        title: Authentication Method
+        description: Authentication methods allowed to use as a comma 
separated list of values Basic, Digest or NTLM.
+        type: string
+        default: "Basic"
+      authenticationPreemptive:
+        title: Authentication Preemptive
+        description: If this option is true, camel-http sends preemptive basic 
authentication to the server.
+        type: boolean
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        default: false
+      authUsername:
+        title: Authentication Username
+        description: Authentication username
+        type: string
+      authPassword:
+        title: Authentication Password
+        description: Authentication password
+        type: string
+  dependencies:
+    - "camel:http"
+    - "camel:kamelet"
+    - "camel:core"
+    - "camel:timer"
+  flow:
+    from:
+      uri: "timer:fetch"
+      parameters:
+        period: "{{period}}"
+      steps:
+      - set-header:
+          name: "Accept"
+          constant: "{{contentType}}"
+      - to:
+          uri: "{{url}}"
+          parameters: 
+            authMethod: "{{authMethod}}"
+            authUsername: "{{authUsername}}"
+            authPassword: "{{authPassword}}"
+            authenticationPreemptive: "{{authenticationPreemptive}}"
+      - to: "kamelet:sink"
diff --git a/karavan-designer/public/kamelets/http-sink.kamelet.yaml 
b/karavan-designer/public/kamelets/http-sink.kamelet.yaml
new file mode 100644
index 0000000..da8776e
--- /dev/null
+++ b/karavan-designer/public/kamelets/http-sink.kamelet.yaml
@@ -0,0 +1,43 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: http-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMC
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "HTTP"
+  labels:
+    camel.apache.org/kamelet.type: sink
+spec:
+  definition:
+    title: HTTP Sink
+    description: Forwards an event to a HTTP endpoint
+    required:
+    - url
+    type: object
+    properties:
+      url:
+        title: URL
+        description: The URL to send data to
+        type: string
+        example: "https://my-service/path";
+        pattern: "^(http|https)://.*"
+      method:
+        title: Method
+        description: The HTTP method to use
+        type: string
+        default: POST
+  dependencies:
+  - "camel:http"
+  - "camel:kamelet"
+  - "camel:core"
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+      - set-header:
+          name: CamelHttpMethod
+          constant: "{{method}}"
+      - to: "{{url}}"
diff --git a/karavan-designer/public/kamelets/http-source.kamelet.yaml 
b/karavan-designer/public/kamelets/http-source.kamelet.yaml
new file mode 100644
index 0000000..15897e5
--- /dev/null
+++ b/karavan-designer/public/kamelets/http-source.kamelet.yaml
@@ -0,0 +1,53 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: http-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMC
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "HTTP"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "HTTP Source"
+    description: |-
+      Periodically fetches an HTTP resource and provides the content as output.
+    required:
+    - url
+    type: object
+    properties:
+      period:
+        title: Period between Updates
+        description: The interval between fetches in milliseconds
+        type: integer
+        default: 10000
+      contentType:
+        title: Content Type
+        description: The content type accepted for the resource
+        type: string
+        default: "application/json"
+      url:
+        title: URL
+        description: The URL to fetch for data
+        type: string
+        example: 
"https://gist.githubusercontent.com/nicolaferraro/e3c72ace3c751f9f88273896611ce5fe/raw/3b6f54060bacb56b6719b7386a4645cb59ad6cc1/quote.json";
+        pattern: "^(http|https)://.*"
+  dependencies:
+    - "camel:http"
+    - "camel:kamelet"
+    - "camel:core"
+    - "camel:timer"
+  flow:
+    from:
+      uri: "timer:fetch"
+      parameters:
+        period: "{{period}}"
+      steps:
+      - set-header:
+          name: "Accept"
+          constant: "{{contentType}}"
+      - to: "{{url}}"
+      - to: "kamelet:sink"
diff --git a/karavan-designer/public/kamelets/insert-field-action.kamelet.yaml 
b/karavan-designer/public/kamelets/insert-field-action.kamelet.yaml
new file mode 100644
index 0000000..0abc031
--- /dev/null
+++ b/karavan-designer/public/kamelets/insert-field-action.kamelet.yaml
@@ -0,0 +1,67 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: insert-field-action
+  labels:
+    camel.apache.org/kamelet.type: "action"
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Actions"
+spec:
+  definition:
+    title: "Insert Field Action"
+    description: "Adds a custom field with a constant value to the message in 
transit"
+    required:
+      - field
+      - value
+    properties:
+      field:
+        title: Field
+        description: The name of the field to be added
+        type: string
+      value:
+        title: Value
+        description: The value of the field
+        type: string
+    type: object
+  dependencies:
+  - "mvn:org.apache.camel.kamelets:camel-kamelets-utils:0.3.0"
+  - "camel:core"
+  - "camel:jackson"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+      - choice:
+          when:
+          - simple: "${header[Content-Type]} == 'application/json'"
+            steps:
+            - set-property:
+                name: deserialized
+                constant: "true"
+            - unmarshal:
+                json: 
+                  library: Jackson
+                  unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
+      - set-property:
+          name: "field"
+          constant: "{{field}}"
+      - set-property:
+          name: "value"
+          constant: "{{value}}"
+      - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
+      - choice:
+          when:
+          - simple: "${exchangeProperty[deserialized]} == 'true'"
+            steps:
+            - marshal:
+                json: 
+                  library: Jackson
+                  unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
+            - set-header:
+                name: "Content-Type"
+                constant: "application/json"
diff --git a/karavan-designer/public/kamelets/insert-header-action.kamelet.yaml 
b/karavan-designer/public/kamelets/insert-header-action.kamelet.yaml
new file mode 100644
index 0000000..5795bab
--- /dev/null
+++ b/karavan-designer/public/kamelets/insert-header-action.kamelet.yaml
@@ -0,0 +1,40 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: insert-header-action
+  labels:
+    camel.apache.org/kamelet.type: "action"
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Actions"
+spec:
+  definition:
+    title: "Insert Header Action"
+    description: "Adds an header with a constant value to the message in 
transit"
+    required:
+      - name
+      - value
+    properties:
+      name:
+        title: Name
+        description: The name of the header to be added
+        type: string
+        example: headername
+      value:
+        title: Value
+        description: The value of the header
+        type: string
+    type: object
+  dependencies:
+    - "camel:core"
+    - "camel:kamelet"
+  flow:
+    from:
+      uri: kamelet:source
+      steps:
+      - set-header:
+          name: "{{name}}"
+          constant: "{{value}}"
diff --git 
a/karavan-designer/public/kamelets/kafka-not-secured-sink.kamelet.yaml 
b/karavan-designer/public/kamelets/kafka-not-secured-sink.kamelet.yaml
new file mode 100644
index 0000000..281d856
--- /dev/null
+++ b/karavan-designer/public/kamelets/kafka-not-secured-sink.kamelet.yaml
@@ -0,0 +1,73 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: kafka-not-secured-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA1MDAgNTAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MD
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Kafka"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "Kafka Not Secured Sink"
+    description: |-
+      Send data to Kafka topics on an insecure broker.
+
+      The Kamelet is able to understand the following headers to be set:
+
+      - `key` / `ce-key`: as message key
+    
+      - `partition-key` / `ce-partition-key`: as message partition key
+
+      Both the headers are optional.
+    required:
+      - topic
+      - brokers
+    type: object
+    properties:
+      topic:
+        title: Topic Names
+        description: Comma separated list of Kafka topic names
+        type: string
+      brokers:
+        title: Brokers
+        description: Comma separated list of Kafka Broker URLs
+        type: string
+  dependencies:
+    - "camel:kafka"
+    - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - choice:
+          when:
+          - simple: "${header[key]}"
+            steps:
+            - set-header:
+                name: kafka.KEY
+                simple: "${header[key]}"
+          - simple: "${header[ce-key]}"
+            steps:
+            - set-header:
+                name: kafka.KEY
+                simple: "${header[ce-key]}"
+      - choice:
+          when:
+          - simple: "${header[partition-key]}"
+            steps:
+            - set-header:
+                name: kafka.PARTITION_KEY
+                simple: "${header[partition-key]}"
+          - simple: "${header[ce-partition-key]}"
+            steps:
+            - set-header:
+                name: kafka.PARTITION_KEY
+                simple: "${header[ce-partition-key]}"
+      - to:
+          uri: "kafka:{{topic}}"
+          parameters:
+            brokers: "{{brokers}}"
diff --git 
a/karavan-designer/public/kamelets/kafka-not-secured-source.kamelet.yaml 
b/karavan-designer/public/kamelets/kafka-not-secured-source.kamelet.yaml
new file mode 100644
index 0000000..3a56fda
--- /dev/null
+++ b/karavan-designer/public/kamelets/kafka-not-secured-source.kamelet.yaml
@@ -0,0 +1,68 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: kafka-not-secured-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA1MDAgNTAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MD
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Kafka"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Kafka Not Secured Source"
+    description: |-
+      Receive data from Kafka topics on an insecure broker.
+    required:
+      - topic
+      - brokers
+    type: object
+    properties:
+      topic:
+        title: Topic Names
+        description: Comma separated list of Kafka topic names
+        type: string
+      brokers:
+        title: Brokers
+        description: Comma separated list of Kafka Broker URLs
+        type: string
+      autoCommitEnable:
+        title: Auto Commit Enable
+        description: If true, periodically commit to ZooKeeper the offset of 
messages already fetched by the consumer
+        type: boolean
+        default: true
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+      allowManualCommit:
+        title: Allow Manual Commit
+        description: Whether to allow doing manual commits
+        type: boolean
+        default: false
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+      pollOnError:
+        title: Poll On Error Behavior
+        description: What to do if kafka threw an exception while polling for 
new messages. There are 5 enums and the value can be one of DISCARD, 
ERROR_HANDLER, RECONNECT, RETRY, STOP
+        type: string
+        default: "ERROR_HANDLER"
+      autoOffsetReset:
+        title: Auto Offset Reset
+        description: What to do when there is no initial offset. There are 3 
enums and the value can be one of latest, earliest, none
+        type: string
+        default: "latest"
+  dependencies:
+    - "camel:kafka"
+    - "camel:kamelet"
+  flow:
+    from:
+      uri: "kafka:{{topic}}"
+      parameters:
+        brokers: "{{brokers}}"
+        autoCommitEnable: "{{autoCommitEnable}}"
+        allowManualCommit: "{{allowManualCommit}}"
+        pollOnError: "{{pollOnError}}"
+        autoOffsetReset: "{{autoOffsetReset}}"
+      steps:
+      - to: "kamelet:sink"
diff --git a/karavan-designer/public/kamelets/kafka-sink.kamelet.yaml 
b/karavan-designer/public/kamelets/kafka-sink.kamelet.yaml
new file mode 100644
index 0000000..e0eddbc
--- /dev/null
+++ b/karavan-designer/public/kamelets/kafka-sink.kamelet.yaml
@@ -0,0 +1,99 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: kafka-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA1MDAgNTAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MD
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Kafka"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "Kafka Sink"
+    description: |-
+      Send data to Kafka topics.
+
+      The Kamelet is able to understand the following headers to be set:
+
+      - `key` / `ce-key`: as message key
+    
+      - `partition-key` / `ce-partition-key`: as message partition key
+
+      Both the headers are optional.
+    required:
+      - topic
+      - brokers
+      - username
+      - password
+    type: object
+    properties:
+      topic:
+        title: Topic Names
+        description: Comma separated list of Kafka topic names
+        type: string
+      brokers:
+        title: Brokers
+        description: Comma separated list of Kafka Broker URLs
+        type: string
+      securityProtocol:
+        title: Security Protocol
+        description: Protocol used to communicate with brokers. 
SASL_PLAINTEXT, PLAINTEXT, SASL_SSL and SSL are supported
+        type: string
+        default: SASL_SSL
+      saslMechanism:
+        title: SASL Mechanism
+        description: The Simple Authentication and Security Layer (SASL) 
Mechanism used. 
+        type: string
+        default: PLAIN
+      username:
+        title: Username
+        description: Username to authenticate to Kafka 
+        type: string
+      password:
+        title: Password
+        description: Password to authenticate to kafka
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+  dependencies:
+    - "camel:kafka"
+    - "camel:kamelet"
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - choice:
+          when:
+          - simple: "${header[key]}"
+            steps:
+            - set-header:
+                name: kafka.KEY
+                simple: "${header[key]}"
+          - simple: "${header[ce-key]}"
+            steps:
+            - set-header:
+                name: kafka.KEY
+                simple: "${header[ce-key]}"
+      - choice:
+          when:
+          - simple: "${header[partition-key]}"
+            steps:
+            - set-header:
+                name: kafka.PARTITION_KEY
+                simple: "${header[partition-key]}"
+          - simple: "${header[ce-partition-key]}"
+            steps:
+            - set-header:
+                name: kafka.PARTITION_KEY
+                simple: "${header[ce-partition-key]}"
+      - to:
+          uri: "kafka:{{topic}}"
+          parameters:
+            brokers: "{{brokers}}"
+            securityProtocol: "{{securityProtocol}}"
+            saslMechanism: "{{saslMechanism}}"
+            saslJaasConfig: 
"org.apache.kafka.common.security.plain.PlainLoginModule required 
username='{{username}}' password='{{password}}';"
diff --git a/karavan-designer/public/kamelets/kafka-source.kamelet.yaml 
b/karavan-designer/public/kamelets/kafka-source.kamelet.yaml
new file mode 100644
index 0000000..cabace9
--- /dev/null
+++ b/karavan-designer/public/kamelets/kafka-source.kamelet.yaml
@@ -0,0 +1,94 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: kafka-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "0.3.0"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA1MDAgNTAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MD
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Kafka"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Kafka Source"
+    description: |-
+      Receive data from Kafka topics.
+    required:
+      - topic
+      - brokers
+      - username
+      - password
+    type: object
+    properties:
+      topic:
+        title: Topic Names
+        description: Comma separated list of Kafka topic names
+        type: string
+      brokers:
+        title: Brokers
+        description: Comma separated list of Kafka Broker URLs
+        type: string
+      securityProtocol:
+        title: Security Protocol
+        description: Protocol used to communicate with brokers. 
SASL_PLAINTEXT, PLAINTEXT, SASL_SSL and SSL are supported
+        type: string
+        default: SASL_SSL
+      saslMechanism:
+        title: SASL Mechanism
+        description: The Simple Authentication and Security Layer (SASL) 
Mechanism used. 
+        type: string
+        default: PLAIN
+      username:
+        title: Username
+        description: Username to authenticate to Kafka 
+        type: string
+      password:
+        title: Password
+        description: Password to authenticate to kafka
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      autoCommitEnable:
+        title: Auto Commit Enable
+        description: If true, periodically commit to ZooKeeper the offset of 
messages already fetched by the consumer
+        type: boolean
+        default: true
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+      allowManualCommit:
+        title: Allow Manual Commit
+        description: Whether to allow doing manual commits
+        type: boolean
+        default: false
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+      pollOnError:
+        title: Poll On Error Behavior
+        description: What to do if kafka threw an exception while polling for 
new messages. There are 5 enums and the value can be one of DISCARD, 
ERROR_HANDLER, RECONNECT, RETRY, STOP
+        type: string
+        default: "ERROR_HANDLER"
+      autoOffsetReset:
+        title: Auto Offset Reset
+        description: What to do when there is no initial offset. There are 3 
enums and the value can be one of latest, earliest, none
+        type: string
+        default: "latest"
+  dependencies:
+    - "camel:kafka"
+    - "camel:kamelet"
+  flow:
+    from:
+      uri: "kafka:{{topic}}"
+      parameters:
+        brokers: "{{brokers}}"
+        securityProtocol: "{{securityProtocol}}"
+        saslMechanism: "{{saslMechanism}}"
+        saslJaasConfig: 
"org.apache.kafka.common.security.plain.PlainLoginModule required 
username='{{username}}' password='{{password}}';"
+        autoCommitEnable: "{{autoCommitEnable}}"
+        allowManualCommit: "{{allowManualCommit}}"
+        pollOnError: "{{pollOnError}}"
+        autoOffsetReset: "{{autoOffsetReset}}"
+      steps:
+      - to: "kamelet:sink"

Reply via email to