You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/06/18 11:38:24 UTC

[camel-kamelets] branch main updated (d3b37e1 -> 0f1b1c6)

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

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


    from d3b37e1  Added PostgreSQL Source Kamelet
     new ba783f7  Added MySQL Source Kamelet
     new 05c0842  Added MySQL Source Kamelet
     new 2e2f6c7  Added MySQL Source Kamelet
     new 0f1b1c6  Added MySQL Source Kamelet

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../kamelets/{mysql-sink.svg => mysql-source.svg}  |  0
 docs/modules/ROOT/nav.adoc                         |  1 +
 .../pages/{mysql-sink.adoc => mysql-source.adoc}   | 43 +++++++++-------------
 .../resources/kamelets/mysql-source.kamelet.yaml   | 38 +++++++++----------
 ...-sink.kamelet.yaml => mysql-source.kamelet.yaml | 38 +++++++++----------
 5 files changed, 55 insertions(+), 65 deletions(-)
 copy docs/modules/ROOT/assets/images/kamelets/{mysql-sink.svg => mysql-source.svg} (100%)
 copy docs/modules/ROOT/pages/{mysql-sink.adoc => mysql-source.adoc} (69%)
 copy mysql-sink.kamelet.yaml => library/camel-kamelets-catalog/src/main/resources/kamelets/mysql-source.kamelet.yaml (93%)
 copy mysql-sink.kamelet.yaml => mysql-source.kamelet.yaml (93%)

[camel-kamelets] 03/04: Added MySQL Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2e2f6c79e563c9c027cbe801e57ae72ad2065e59
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 18 13:21:42 2021 +0200

    Added MySQL Source Kamelet
---
 docs/modules/ROOT/nav.adoc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 692b0a1..c5666e0 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -80,6 +80,7 @@
 * xref:ROOT:minio-source.adoc[image:kamelets/minio-source.svg[] Minio Source]
 * xref:ROOT:mqtt-source.adoc[image:kamelets/mqtt-source.svg[] MQTT Source]
 * xref:ROOT:mysql-sink.adoc[image:kamelets/mysql-sink.svg[] MySQL Sink]
+* xref:ROOT:mysql-source.adoc[image:kamelets/mysql-source.svg[] MySQL Source]
 * xref:ROOT:nats-sink.adoc[image:kamelets/nats-sink.svg[] NATS Sink]
 * xref:ROOT:nats-source.adoc[image:kamelets/nats-source.svg[] NATS Source]
 * xref:ROOT:openai-classification-action.adoc[image:kamelets/openai-classification-action.svg[] OpenAI Classification Action]

[camel-kamelets] 01/04: Added MySQL Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ba783f7737a899e045f807a3fddf2346a1d02c4a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 18 13:20:16 2021 +0200

    Added MySQL Source Kamelet
---
 mysql-source.kamelet.yaml | 96 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/mysql-source.kamelet.yaml b/mysql-source.kamelet.yaml
new file mode 100644
index 0000000..345f522
--- /dev/null
+++ b/mysql-source.kamelet.yaml
@@ -0,0 +1,96 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: mysql-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmVyc2lvbj0iMSI+CiA8cmVjdCBmaWxsPSIjMjY1NTdjIiB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIHg9Ii0zMCIgeT0iLTMwIiByeD0iMS40IiByeT0iMS40IiB0cmFuc2Zvcm09Im1hdHJpeCgwLC0xLC0xLDAsMCwwKSIvPgogPHBhdGggb3BhY2l0eT0iLjIiIGQ9Im04LjAyNTQgOC4wMDAxYy0wLjc4MjUtMC4wMTY2LTEuMTQ5NCAwLjUyNDQtMC45ODgzIDEuNDU3IDAuMDUyIDAuMzAwNiAwLjMxNTIgMC43Mjk5IDAuODgyOCAxLjQ0MTkgMC42MzEyMiAwLj [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SQL"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "MySQL Source"
+    description: |-
+      Query data from a MySQL Database.
+
+      In you KameletBinding file you'll need to explicitly declare the SQL Server driver dependency in spec->integration->dependencies
+      
+      - "mvn:mysql:mysql-connector-java:<version>"
+    required:
+      - serverName
+      - username
+      - password
+      - query
+      - databaseName
+    type: object
+    properties:
+      serverName:
+        title: Server Name
+        description: Server Name for the data source
+        type: string
+        example: localhost
+      port:
+        title: Port
+        description: Server Port for the data source
+        type: string
+        default: 3306
+      username:
+        title: Username
+        description: The username to use for accessing a secured MySQL Database
+        type: string
+      password:
+        title: Password
+        description: The password to use for accessing a secured MySQL Database
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      query:
+        title: Query
+        description: The Query to execute against the MySQL Database
+        type: string
+        example: 'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
+      databaseName:
+        title: Database Name
+        description: The Database Name we are pointing
+        type: string
+      consumedQuery:
+        title: Consumed Query
+        description: A query to run on a tuple consumed
+        type: string
+        example: 'DELETE FROM accounts where user_id = :#user_id'
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  - "camel:kamelet"
+  - "camel:sql"
+  - "mvn:org.apache.commons:commons-dbcp2:2.8.0"
+  flow:
+    beans:
+      - name: dsBean
+        type: "#class:org.apache.commons.dbcp2.BasicDataSource"
+        property:
+          - key: username
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'
+          - key: url
+            value: 'jdbc:mysql://{{serverName}}:{{port}}/{{databaseName}}'
+          - key: driverClassName
+            value: 'com.mysql.cj.jdbc.Driver'
+    from:
+      uri: "sql:{{query}}"
+      parameters:
+        dataSource: "#bean:{{dsBean}}"
+        onConsume: "{{?consumedQuery}}"
+      steps:
+      - marshal:
+          json: 
+            library: Jackson
+      - to: "kamelet:sink"
+

[camel-kamelets] 04/04: Added MySQL Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0f1b1c6f74f8739ca0d714eb785f3f7301071134
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 18 13:21:50 2021 +0200

    Added MySQL Source Kamelet
---
 .../ROOT/assets/images/kamelets/mysql-source.svg   |  7 ++
 docs/modules/ROOT/pages/mysql-source.adoc          | 76 ++++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/mysql-source.svg b/docs/modules/ROOT/assets/images/kamelets/mysql-source.svg
new file mode 100644
index 0000000..e7224e2
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/mysql-source.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" version="1">
+ <rect fill="#26557c" width="28" height="28" x="-30" y="-30" rx="1.4" ry="1.4" transform="matrix(0,-1,-1,0,0,0)"/>
+ <path opacity=".2" d="m8.0254 8.0001c-0.7825-0.0166-1.1494 0.5244-0.9883 1.457 0.052 0.3006 0.3152 0.7299 0.8828 1.4419 0.63122 0.7909 0.88514 1.2227 1.1602 1.9707 0.4336 1.1793 0.63403 1.5748 0.98633 1.9434 0.27366 0.2863 0.27369 0.28712 0.08984 0.87109-0.28507 0.90556-0.34407 2.7207-0.11523 3.5742 0.34248 1.2774 0.76402 1.8574 1.3516 1.8574 0.41968 0 0.76364-0.35092 0.88672-0.9043 0.04268-0.19186 0.12249-0.46607 0.17773-0.60938 0.09535-0.24728 0.12093-0.22818 0.49414 0.38086 0.21628 0 [...]
+ <path fill="#fff" d="m8.0254 7c-0.7825-0.0166-1.1494 0.5244-0.9883 1.457 0.052 0.3006 0.3152 0.7302 0.8828 1.4414 0.6312 0.7906 0.8852 1.2226 1.1602 1.9706 0.4336 1.179 0.634 1.575 0.9859 1.943 0.274 0.287 0.274 0.288 0.09 0.872-0.2848 0.905-0.3438 2.72-0.115 3.574 0.342 1.277 0.764 1.857 1.352 1.857 0.419 0 0.763-0.351 0.886-0.904 0.043-0.192 0.123-0.466 0.178-0.609 0.095-0.248 0.121-0.229 0.494 0.38 0.216 0.353 0.629 0.879 0.916 1.168 0.664 0.669 1.575 1.422 1.641 1.358 0.028-0.027-0. [...]
+ <path fill="#fff" opacity=".1" d="m3.4004 2c-0.7756 0-1.4004 0.6248-1.4004 1.4004v1c0-0.7756 0.6248-1.4004 1.4004-1.4004h25.2c0.775 0 1.4 0.6248 1.4 1.4004v-1c0-0.7756-0.625-1.4004-1.4-1.4004h-25.2z"/>
+ <path opacity=".2" d="m2 28.6v1c0 0.775 0.6248 1.4 1.4004 1.4h25.2c0.775 0 1.4-0.625 1.4-1.4v-1c0 0.775-0.625 1.4-1.4 1.4h-25.2c-0.7752 0-1.4-0.625-1.4-1.4z"/>
+</svg>
diff --git a/docs/modules/ROOT/pages/mysql-source.adoc b/docs/modules/ROOT/pages/mysql-source.adoc
new file mode 100644
index 0000000..d5587c8
--- /dev/null
+++ b/docs/modules/ROOT/pages/mysql-source.adoc
@@ -0,0 +1,76 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/mysql-source.svg[] MySQL Source
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Query data from a MySQL Database.
+
+In you KameletBinding file you'll need to explicitly declare the SQL Server driver dependency in spec->integration->dependencies
+
+- "mvn:mysql:mysql-connector-java:<version>"
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `mysql-source` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *databaseName {empty}* *| Database Name| The Database Name we are pointing| string| | 
+| *password {empty}* *| Password| The password to use for accessing a secured MySQL Database| string| | 
+| *query {empty}* *| Query| The Query to execute against the MySQL Database| string| | `"INSERT INTO accounts (username,city) VALUES (:#username,:#city)"`
+| *serverName {empty}* *| Server Name| Server Name for the data source| string| | `"localhost"`
+| *username {empty}* *| Username| The username to use for accessing a secured MySQL Database| string| | 
+| consumedQuery| Consumed Query| A query to run on a tuple consumed| string| | `"DELETE FROM accounts where user_id = :#user_id"`
+| port| Port| Server Port for the data source| string| `3306`| 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `mysql-source` can be used in various contexts.
+
+=== Knative Source
+
+The `mysql-source` Kamelet can be used as Knative source by binding it to a Knative object.
+
+.mysql-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: mysql-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: mysql-source
+    properties:
+      databaseName: "The Database Name"
+      password: "The Password"
+      query: "INSERT INTO accounts (username,city) VALUES (:#username,:#city)"
+      serverName: "localhost"
+      username: "The Username"
+  sink:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+
+----
+
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.
+
+Save the `mysql-source-binding.yaml` file into your hard drive, then configure it according to your needs.
+
+You can run the source using the following command:
+
+[source,shell]
+----
+kubectl apply -f mysql-source-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT

[camel-kamelets] 02/04: Added MySQL Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 05c0842df26784a126c3be8ffd7d8cc628e2f08b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 18 13:21:21 2021 +0200

    Added MySQL Source Kamelet
---
 .../resources/kamelets/mysql-source.kamelet.yaml   | 96 ++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/mysql-source.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/mysql-source.kamelet.yaml
new file mode 100644
index 0000000..345f522
--- /dev/null
+++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/mysql-source.kamelet.yaml
@@ -0,0 +1,96 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: mysql-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmVyc2lvbj0iMSI+CiA8cmVjdCBmaWxsPSIjMjY1NTdjIiB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIHg9Ii0zMCIgeT0iLTMwIiByeD0iMS40IiByeT0iMS40IiB0cmFuc2Zvcm09Im1hdHJpeCgwLC0xLC0xLDAsMCwwKSIvPgogPHBhdGggb3BhY2l0eT0iLjIiIGQ9Im04LjAyNTQgOC4wMDAxYy0wLjc4MjUtMC4wMTY2LTEuMTQ5NCAwLjUyNDQtMC45ODgzIDEuNDU3IDAuMDUyIDAuMzAwNiAwLjMxNTIgMC43Mjk5IDAuODgyOCAxLjQ0MTkgMC42MzEyMiAwLj [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SQL"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "MySQL Source"
+    description: |-
+      Query data from a MySQL Database.
+
+      In you KameletBinding file you'll need to explicitly declare the SQL Server driver dependency in spec->integration->dependencies
+      
+      - "mvn:mysql:mysql-connector-java:<version>"
+    required:
+      - serverName
+      - username
+      - password
+      - query
+      - databaseName
+    type: object
+    properties:
+      serverName:
+        title: Server Name
+        description: Server Name for the data source
+        type: string
+        example: localhost
+      port:
+        title: Port
+        description: Server Port for the data source
+        type: string
+        default: 3306
+      username:
+        title: Username
+        description: The username to use for accessing a secured MySQL Database
+        type: string
+      password:
+        title: Password
+        description: The password to use for accessing a secured MySQL Database
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      query:
+        title: Query
+        description: The Query to execute against the MySQL Database
+        type: string
+        example: 'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
+      databaseName:
+        title: Database Name
+        description: The Database Name we are pointing
+        type: string
+      consumedQuery:
+        title: Consumed Query
+        description: A query to run on a tuple consumed
+        type: string
+        example: 'DELETE FROM accounts where user_id = :#user_id'
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  - "camel:kamelet"
+  - "camel:sql"
+  - "mvn:org.apache.commons:commons-dbcp2:2.8.0"
+  flow:
+    beans:
+      - name: dsBean
+        type: "#class:org.apache.commons.dbcp2.BasicDataSource"
+        property:
+          - key: username
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'
+          - key: url
+            value: 'jdbc:mysql://{{serverName}}:{{port}}/{{databaseName}}'
+          - key: driverClassName
+            value: 'com.mysql.cj.jdbc.Driver'
+    from:
+      uri: "sql:{{query}}"
+      parameters:
+        dataSource: "#bean:{{dsBean}}"
+        onConsume: "{{?consumedQuery}}"
+      steps:
+      - marshal:
+          json: 
+            library: Jackson
+      - to: "kamelet:sink"
+