kamelets.mysql-source.kamelet.yaml Maven / Gradle / Ivy
The newest version!
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: mysql-source
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "4.8.0"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmVyc2lvbj0iMS4wIj4KIDxyZWN0IGZpbGw9IiMyNjU1N2MiIHdpZHRoPSIyOCIgaGVpZ2h0PSIyOCIgeD0iLTMwIiB5PSItMzAiIHJ4PSIxLjQiIHJ5PSIxLjQiIHRyYW5zZm9ybT0ibWF0cml4KDAsLTEsLTEsMCwwLDApIi8+CiA8cGF0aCBvcGFjaXR5PSIuMiIgZD0ibTguMDI1NCA4LjAwMDFjLTAuNzgyNS0wLjAxNjYtMS4xNDk0IDAuNTI0NC0wLjk4ODMgMS40NTcgMC4wNTIgMC4zMDA2IDAuMzE1MiAwLjcyOTkgMC44ODI4IDEuNDQxOSAwLjYzMTIyIDAuNzkwOSAwLjg4NTE0IDEuMjIyNyAxLjE2MDIgMS45NzA3IDAuNDMzNiAxLjE3OTMgMC42MzQwMyAxLjU3NDggMC45ODYzMyAxLjk0MzQgMC4yNzM2NiAwLjI4NjMgMC4yNzM2OSAwLjI4NzEyI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NDAwNGgyNS4yYzAuNzc1IDAgMS40IDAuNjI0OCAxLjQgMS40MDA0di0xYzAtMC43NzU2LTAuNjI1LTEuNDAwNC0xLjQtMS40MDA0aC0yNS4yeiIvPgogPHBhdGggb3BhY2l0eT0iLjIiIGQ9Im0yIDI4LjZ2MWMwIDAuNzc1IDAuNjI0OCAxLjQgMS40MDA0IDEuNGgyNS4yYzAuNzc1IDAgMS40LTAuNjI1IDEuNC0xLjR2LTFjMCAwLjc3NS0wLjYyNSAxLjQtMS40IDEuNGgtMjUuMmMtMC43NzUyIDAtMS40LTAuNjI1LTEuNC0xLjR6Ii8+Cjwvc3ZnPgo="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "SQL"
camel.apache.org/kamelet.namespace: "Database"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "MySQL Source"
description: |-
Query data from 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:"
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: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
consumedQuery:
title: Consumed Query
description: A query to run on a tuple consumed.
type: string
example: 'DELETE FROM accounts where user_id = :#user_id'
delay:
title: Delay
description: The number of milliseconds before the next poll
type: integer
default: 500
types:
out:
mediaType: application/json
dependencies:
- "camel:jackson"
- "camel:kamelet"
- "camel:sql"
- "mvn:org.apache.commons:commons-dbcp2:2.12.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: "sql:{{query}}"
parameters:
dataSource: "#bean:{{dsBean}}"
onConsume: "{{?consumedQuery}}"
delay: "{{delay}}"
steps:
- marshal:
json:
library: Jackson
- to: "kamelet:sink"