-
Notifications
You must be signed in to change notification settings - Fork 26
/
mysql-sink.kamelet.yaml
98 lines (92 loc) · 8.96 KB
/
mysql-sink.kamelet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: mysql-sink
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "2.3.0"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmVyc2lvbj0iMS4wIj4KIDxyZWN0IGZpbGw9IiMyNjU1N2MiIHdpZHRoPSIyOCIgaGVpZ2h0PSIyOCIgeD0iLTMwIiB5PSItMzAiIHJ4PSIxLjQiIHJ5PSIxLjQiIHRyYW5zZm9ybT0ibWF0cml4KDAsLTEsLTEsMCwwLDApIi8+CiA8cGF0aCBvcGFjaXR5PSIuMiIgZD0ibTguMDI1NCA4LjAwMDFjLTAuNzgyNS0wLjAxNjYtMS4xNDk0IDAuNTI0NC0wLjk4ODMgMS40NTcgMC4wNTIgMC4zMDA2IDAuMzE1MiAwLjcyOTkgMC44ODI4IDEuNDQxOSAwLjYzMTIyIDAuNzkwOSAwLjg4NTE0IDEuMjIyNyAxLjE2MDIgMS45NzA3IDAuNDMzNiAxLjE3OTMgMC42MzQwMyAxLjU3NDggMC45ODYzMyAxLjk0MzQgMC4yNzM2NiAwLjI4NjMgMC4yNzM2OSAwLjI4NzEyIDAuMDg5ODQgMC44NzEwOS0wLjI4NTA3IDAuOTA1NTYtMC4zNDQwNyAyLjcyMD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NzU2LTAuNjI1LTEuNDAwNC0xLjQtMS40MDA0aC0yNS4yeiIvPgogPHBhdGggb3BhY2l0eT0iLjIiIGQ9Im0yIDI4LjZ2MWMwIDAuNzc1IDAuNjI0OCAxLjQgMS40MDA0IDEuNGgyNS4yYzAuNzc1IDAgMS40LTAuNjI1IDEuNC0xLjR2LTFjMCAwLjc3NS0wLjYyNSAxLjQtMS40IDEuNGgtMjUuMmMtMC43NzUyIDAtMS40LTAuNjI1LTEuNC0xLjR6Ii8+Cjwvc3ZnPgo="
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.group: "SQL"
camel.apache.org/kamelet.namespace: "Database"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "MySQL Sink"
description: |-
Send data to a MySQL Database.
In your Pipe file, you must explicitly declare the SQL Server driver dependency in spec->integration->dependencies.
- "mvn:mysql:mysql-connector-java:<version>"
This Kamelet expects a JSON-formatted body. Use key:value pairs to map the JSON fields and parameters. For example, here is a query:
'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
Here is example input for the example query:
'{ "username":"oscerd", "city":"Rome"}'
required:
- serverName
- username
- password
- query
- databaseName
type: object
properties:
serverName:
title: Server Name
description: The server name for the data source.
type: string
example: localhost
serverPort:
title: Server Port
description: The server port for the data source.
type: string
default: 3306
username:
title: Username
description: The username to access a secured MySQL Database.
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: The password to access a secured MySQL Database.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
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 name of the MySQL Database.
type: string
types:
in:
mediaType: application/json
dependencies:
- "camel:jackson"
- "camel:kamelet"
- "camel:sql"
- "mvn:org.apache.commons:commons-dbcp2:2.10.0"
template:
beans:
- name: dsBean
type: "#class:org.apache.commons.dbcp2.BasicDataSource"
properties:
username: '{{username}}'
password: '{{password}}'
url: 'jdbc:mysql://{{serverName}}:{{serverPort}}/{{databaseName}}'
driverClassName: 'com.mysql.cj.jdbc.Driver'
from:
uri: "kamelet:source"
steps:
- unmarshal:
json:
library: Jackson
- to:
uri: "sql:{{query}}"
parameters:
dataSource: "#bean:{{dsBean}}"