GithubHelp home page GithubHelp logo

kafka-connect-attunity-conversion's Introduction

Kafka Connect Attunity Conversion

This project is a POC taking the JSON generated by Attunity and converting it to the proper Kafka connect data types. This is not production code and not a replacement for a proper Kafka Connect Connector for Attunity.

Current limitations

Limited types are supported.

All of the data that is coming from Attunity is currently formatted as strings and requires proper conversion to the strongly typed Kafka Connect data type. The only implemented types are below.

Type Notes Implementation
Decimal Finished
String Finished
Timestamp Implementation needs the data from that comes from Attunity Stubbed
Date Implementation needs the data from that comes from Attunity Stubbed

Here is an example of the data that is returned from Attunity.

{
  "task_name": "oracle2kafka",
  "table": "CUSTOMER",
  "schema": "NAVDEMO",
  "op": "F",
  "data": [
    {
      "C_CUSTKEY": "26"
    },
    {
      "C_NAME": "Carol Palmer"
    },
    {
      "C_ADDRESS": "26 Rodeo Drive"
    },
    {
      "C_NATIONKEY": "22"
    },
    {
      "C_PHONE": "32-363-455-4837"
    },
    {
      "C_ACCTBAL": "11371.0500000000"
    },
    {
      "C_MKTSEGMENT": "AUTOMOBILE"
    },
    {
      "C_COMMENT": "NULL"
    }
  ]
}

Schema has the be defined in configuration

The schema currently has to be defined in the configuration file. In the example below input.0 is the first input for the system. The schema and table settings are used to look at the kafka topic and select which record will get processed. These settings match the schema and table fields in the json above.

input.0.schema=NAVDEMO
input.0.table=CUSTOMER
input.0.kafka.topic=connect_navdemo_customer
input.0.keys=C_CUSTKEY
input.0.fields.C_CUSTKEY.type=decimal
input.0.fields.C_CUSTKEY.precision=10
input.0.fields.C_CUSTKEY.scale=0
input.0.fields.C_NAME.type=string
input.0.fields.C_ADDRESS.type=string
input.0.fields.C_NATIONKEY.type=decimal
input.0.fields.C_NATIONKEY.precision=10
input.0.fields.C_NATIONKEY.scale=0
input.0.fields.C_PHONE.type=string
input.0.fields.C_ACCTBAL.type=decimal
input.0.fields.C_ACCTBAL.precision=38
input.0.fields.C_ACCTBAL.scale=10
input.0.fields.C_MKTSEGMENT.type=string
input.0.fields.C_COMMENT.type=string
Name Notes
schema Schema name from the Attunity JSON.
table Table name from the Attunity JSON.
kafka.topic The output Kafka topic the connector will write the normalized data to.
keys The primary keys for the table. These columns will be used for the primary key to Kafka.

Running in development

mvn clean package
export CLASSPATH="$(find target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
$CONFLUENT_HOME/bin/connect-standalone $CONFLUENT_HOME/etc/schema-registry/connect-avro-standalone.properties config/MySourceConnector.properties

kafka-connect-attunity-conversion's People

Contributors

jcustenborder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.