All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kamelets.oracle-database-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: oracle-database-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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIyLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTI1NiwzMUMxMzEuNywzMSwzMSw2Mi41LDMxLDEwMS4zdjU2LjJjMCwzOC44LDEwMC43LDcwLjMsMjI1LDcwLjNzMjI1LTMxLjUsMjI1LTcwLjN2LTU2LjJDNDgxLDYyLjUsMzgwLjMsMzEsMjU2LDMxeiIvPgoJPHBhdGggZD0iTTI1NiwyNzAuMWMtMTI0LjMsMC0yMjUtMzEuNS0yMjUtNzAuM3Y4NC40YzAsMzguOCwxMDAuNyw3MC4zLDIyNSw3MC4zczIyNS0zMS41LDIyNS03MC4zdi04NC40CgkJQzQ4MSwyMzguNiwzODAuMywyNzAuMSwyNTYsMjcwLjF6Ii8+Cgk8cGF0aCBkPSJNMjU2LDM5Ni42Yy0xMjQuMywwLTIyNS0zMS41LTIyNS03MC4zdjg0LjRjMCwzOC44LDEwMC43LDcwLjMsMjI1LDcwLjNzMjI1LTMxLjUsMjI1LTcwLjN2LTg0LjQKCQlDNDgxLDM2NS4yLDM4MC4zLDM5Ni42LDI1NiwzOTYuNnoiLz4KPC9nPgo8L3N2Zz4K"
    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: "Oracle Database Source"
    description: |-
      Query data from an Oracle Database.

      In your Pipe file, you must explicitly declare the Oracle Database driver dependency in spec->integration->dependencies.

      - "mvn:com.oracle.database.jdbc:ojdbc11:"
    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: 1521
      username:
        title: Username
        description: The username to access a secured Oracle Database.
        type: string
        x-descriptors:
        - urn:camel:group:credentials
      password:
        title: Password
        description: The password to access a secured Oracle Database.
        type: string
        format: password
        x-descriptors:
        - urn:camel:group:credentials
      query:
        title: Query
        description: The query to execute against the Oracle Database.
        type: string
        example: 'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
      databaseName:
        title: Database Name
        description: The name of the Oracle 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'
  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:oracle:thin:@{{serverName}}:{{serverPort}}/{{databaseName}}'
          driverClassName: 'oracle.jdbc.driver.OracleDriver'
    from:
      uri: "sql:{{query}}"
      parameters:
        dataSource: "#bean:{{dsBean}}"
        onConsume: "{{?consumedQuery}}"
      steps:
      - marshal:
          json: 
            library: Jackson
      - to: "kamelet:sink"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy