All Projects → agoda-com → kafka-jdbc-connector

agoda-com / kafka-jdbc-connector

Licence: Apache-2.0 license
Simple way to copy data from relational databases into kafka.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to kafka-jdbc-connector

Dataengineeringproject
Example end to end data engineering project.
Stars: ✭ 82 (+331.58%)
Mutual labels:  kafka-connect
Kafka Docker Playground
Playground for Kafka/Confluent Docker experimentations
Stars: ✭ 140 (+636.84%)
Mutual labels:  kafka-connect
Ksql Udf Deep Learning Mqtt Iot
Deep Learning UDF for KSQL for Streaming Anomaly Detection of MQTT IoT Sensor Data
Stars: ✭ 219 (+1052.63%)
Mutual labels:  kafka-connect
Streamx
kafka-connect-s3 : Ingest data from Kafka to Object Stores(s3)
Stars: ✭ 96 (+405.26%)
Mutual labels:  kafka-connect
Kafka Connect Spooldir
Kafka Connect connector for reading CSV files into Kafka.
Stars: ✭ 116 (+510.53%)
Mutual labels:  kafka-connect
Mongo Kafka
MongoDB Kafka Connector
Stars: ✭ 166 (+773.68%)
Mutual labels:  kafka-connect
Kafka Connect Protobuf Converter
Protobuf converter plugin for Kafka Connect
Stars: ✭ 79 (+315.79%)
Mutual labels:  kafka-connect
postgres-kafka-demo
Fully reproducible, Dockerized, step-by-step, demo on how to stream tables from Postgres to Kafka/KSQL back to Postgres. Detailed blog post published on Medium.
Stars: ✭ 128 (+573.68%)
Mutual labels:  kafka-connect
Kafka Connect Mongodb
**Unofficial / Community** Kafka Connect MongoDB Sink Connector - Find the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector
Stars: ✭ 137 (+621.05%)
Mutual labels:  kafka-connect
Hivemq Mqtt Tensorflow Kafka Realtime Iot Machine Learning Training Inference
Real Time Big Data / IoT Machine Learning (Model Training and Inference) with HiveMQ (MQTT), TensorFlow IO and Apache Kafka - no additional data store like S3, HDFS or Spark required
Stars: ✭ 204 (+973.68%)
Mutual labels:  kafka-connect
Kafka Connect
equivalent to kafka-connect 🔧 for nodejs ✨🐢🚀✨
Stars: ✭ 102 (+436.84%)
Mutual labels:  kafka-connect
Kafka Connect Tools
Kafka Connect Tooling
Stars: ✭ 115 (+505.26%)
Mutual labels:  kafka-connect
Mirus
Mirus is a cross data-center data replication tool for Apache Kafka
Stars: ✭ 171 (+800%)
Mutual labels:  kafka-connect
Kafka Connect Twitter
Kafka Connect connector to stream data in real time from Twitter.
Stars: ✭ 94 (+394.74%)
Mutual labels:  kafka-connect
Kafka Ui
Open-Source Web GUI for Apache Kafka Management
Stars: ✭ 230 (+1110.53%)
Mutual labels:  kafka-connect
Kspp
A high performance/ real-time C++ Kafka streams framework (C++17)
Stars: ✭ 80 (+321.05%)
Mutual labels:  kafka-connect
Kafka Connect Storage Cloud
Kafka Connect suite of connectors for Cloud storage (Amazon S3)
Stars: ✭ 153 (+705.26%)
Mutual labels:  kafka-connect
kafka-scala-examples
Examples of Avro, Kafka, Schema Registry, Kafka Streams, Interactive Queries, KSQL, Kafka Connect in Scala
Stars: ✭ 53 (+178.95%)
Mutual labels:  kafka-connect
kafka-connect-fs
Kafka Connect FileSystem Connector
Stars: ✭ 107 (+463.16%)
Mutual labels:  kafka-connect
Strimzi Kafka Operator
Apache Kafka running on Kubernetes
Stars: ✭ 2,833 (+14810.53%)
Mutual labels:  kafka-connect

Build Status Gitter chat License: Apache Maven Central Codecov branch CLA assistant

Kafka JDBC Connector

Simple way to copy data from relational databases into kafka.

To copy data between Kafka and another system, users create a Connector for the system which they want to pull data from or push data to. Connectors come in two flavors: SourceConnectors to import data from another system and SinkConnectors to export data from Kafka to other datasources. This project is an implementation of SourceConnector which allows users to copy data from relational databases into Kafka topics. It provides a flexible way to keep logic of selecting next batch of records inside database stored procedures which is invoked from the connector tasks in each poll cycle.

Following are few advantages of using stored procedures

  • Select only required columns to be returned as a record.
  • Filtering / Grouping rows returned to connector with SQL.
  • Changing logic of returned batch without reconfiguring connector.

Install

build.sbt

libraryDependencies ++= Seq("com.agoda" %% "kafka-jdbc-connector" % "1.2.0")

Change Log

Please refer to Change Log for requirements, supported databases and project changes.

Examples

Click here for examples.

Timestamp mode

Create a stored procedure in MSSQL database

create procedure [dbo].[cdc_table]
	@time datetime,
	@batch int
as
begin
   select top (@batch) *
   from        cdc.table_ct as a
   left join   cdc.lsn_time_mapping as b
   on          a._$start_lsn = b.start_lsn
   where       b.tran_end_time > @time
   order by    b.tran_end_time asc
end

Post the following configutation to Kafka Connect rest interface

{
	"name" : "cdc_timestamp",
	"config" : {
		"tasks.max": "1",
		"connector.class": "com.agoda.kafka.connector.jdbc.JdbcSourceConnector",
		"connection.url" : "jdbc:sqlserver://localhost:1433;user=sa;password=Passw0rd",
		"mode" : "timestamp",
		"stored-procedure.name" : "cdc_table",
		"topic" : "cdc-table-changelogs",
		"batch.max.rows.variable.name" : "batch",
		"timestamp.variable.name" : "time",
		"timestamp.field.name" : "tran_end_time"
	}
}

Incrementing mode

Create a stored procedure in MSSQL database

create procedure [dbo].[cdc_table]
	@id int,
	@batch int
as
begin
   select top (@batch) *
   from        cdc.table_ct
   where       auto_incrementing_id > @id
   order by    auto_incrementing_id asc
end

Post the following configutation to Kafka Connect rest interface

{
	"name" : "cdc_incrementing",
	"config" : {
		"tasks.max": "1",
		"connector.class": "com.agoda.kafka.connector.jdbc.JdbcSourceConnector",
		"connection.url" : "jdbc:sqlserver://localhost:1433;user=sa;password=Passw0rd",
		"mode" : "incrementing",
		"stored-procedure.name" : "cdc_table",
		"topic" : "cdc-table-changelogs",
		"batch.max.rows.variable.name" : "batch",
		"incrementing.variable.name" : "id",
		"incrementing.field.name" : "auto_incrementing_id"
	}
}

Timestamp + Incrementing mode

Create a stored procedure in MSSQL database

create procedure [dbo].[cdc_table]
	@time datetime,
	@id int,
	@batch int
as
begin
   select top (@batch) *
   from        cdc.table_ct as a
   left join   cdc.lsn_time_mapping as b
   on          a._$start_lsn = b.start_lsn
   where       b.tran_end_time > @time
   and         a.auto_incrementing_id > @id
   order by    b.tran_end_time, a.auto_incrementing_id asc
end

Post the following configutation to Kafka Connect rest interface

{
	"name" : "cdc_timestamp_incrementing",
	"config" : {
		"tasks.max": "1",
		"connector.class": "com.agoda.kafka.connector.jdbc.JdbcSourceConnector",
		"connection.url" : "jdbc:sqlserver://localhost:1433;user=sa;password=Passw0rd",
		"mode" : "timestamp+incrementing",
		"stored-procedure.name" : "cdc_table",
		"topic" : "cdc-table-changelogs",
		"batch.max.rows.variable.name" : "batch",
		"timestamp.variable.name" : "time",
		"timestamp.field.name" : "tran_end_time",
		"incrementing.variable.name" : "id",
		"incrementing.field.name" : "auto_incrementing_id"
	}
}

Contributing

Kafka JDBC Connector is an open source project, and depends on its users to improve it. We are more than happy to find you interested in taking the project forward.

Kindly refer to the Contribution Guidelines for detailed information.

Code of Conduct

Please refer to Code of Conduct document.

License

Kafka JDBC Connector is Open Source and available under the Apache License, Version 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].