Skip to content

Commit

Permalink
Initial (#1)
Browse files Browse the repository at this point in the history
* Initial commit. Conversion from a Json Schema to a Connect schema is working properly.

* Mostly working except for arrays.

* Round trip for a converter is working

* Added license headers. Checkstyle.

* Corrected to run on primitives

* Added FromJson transformation.

* Refactor towards having support for inline and file based configs.

* Refactor towards having support for inline and file based configs.

* Round trip decimal support.

* Added example for FromJson.

* Added support to inject a header when messages do not have a schema header.

* Publish to the connect hub.
  • Loading branch information
jcustenborder authored Mar 6, 2020
1 parent 5422c7a commit 16cf9b3
Show file tree
Hide file tree
Showing 45 changed files with 2,771 additions and 504 deletions.
File renamed without changes.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Introduction
[Documentation](https://jcustenborder.github.io/kafka-connect-documentation/projects/kafka-connect-json-schema)

This is a template repository for creating Kafka Connect Plugins.
Installation through the [Confluent Hub Client](https://docs.confluent.io/current/connect/managing/confluent-hub/client.html)

This plugin is used to add additional JSON parsing functionality to Kafka Connect.

## [From Json transformation](https://jcustenborder.github.io/kafka-connect-documentation/projects/kafka-connect-json-schema/transformations/FromJson.html)

The FromJson will read JSON data that is in string on byte form and parse the data to a connect structure based on the JSON schema provided.

# Development

## Building the source

```bash
mvn clean package
```
2 changes: 1 addition & 1 deletion bin/debug.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright © 2019 Jeremy Custenborder (jcustenborder@gmail.com)
# Copyright © 2020 Jeremy Custenborder (jcustenborder@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion config/connect-avro-docker.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright © 2019 Jeremy Custenborder (jcustenborder@gmail.com)
# Copyright © 2020 Jeremy Custenborder (jcustenborder@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright © 2019 Jeremy Custenborder (jcustenborder@gmail.com)
# Copyright © 2020 Jeremy Custenborder (jcustenborder@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,13 +17,13 @@
version: "2"
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.2.2
image: confluentinc/cp-zookeeper:5.4.0
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
kafka:
image: confluentinc/cp-kafka:5.2.2
image: confluentinc/cp-kafka:5.4.0
depends_on:
- zookeeper
ports:
Expand All @@ -33,7 +33,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: "plaintext://kafka:9092"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
schema-registry:
image: confluentinc/cp-schema-registry:5.2.2
image: confluentinc/cp-schema-registry:5.4.0
depends_on:
- kafka
- zookeeper
Expand Down
55 changes: 35 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2019 Jeremy Custenborder (jcustenborder@gmail.com)
Copyright © 2020 Jeremy Custenborder (jcustenborder@gmail.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -24,14 +24,14 @@
<parent>
<groupId>com.github.jcustenborder.kafka.connect</groupId>
<artifactId>kafka-connect-parent</artifactId>
<version>2.2.1-cp1</version>
<version>2.4.0</version>
</parent>
<artifactId>kafka-connect-example</artifactId>
<artifactId>kafka-connect-json-schema</artifactId>
<version>0.0.2-SNAPSHOT</version>
<name>kafka-connect-example</name>
<name>kafka-connect-json-schema</name>
<description>A Kafka Connect connector receiving data from example.</description>
<url>https://github.com/jcustenborder/kafka-connect-example</url>
<inceptionYear>2019</inceptionYear>
<url>https://github.com/jcustenborder/kafka-connect-json-schema</url>
<inceptionYear>2020</inceptionYear>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
Expand All @@ -50,16 +50,28 @@
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/jcustenborder/kafka-connect-example.git</connection>
<developerConnection>scm:git:git@github.com:jcustenborder/kafka-connect-example.git
<connection>scm:git:https://github.com/jcustenborder/kafka-connect-json-schema.git</connection>
<developerConnection>scm:git:git@github.com:jcustenborder/kafka-connect-json-schema.git
</developerConnection>
<url>https://github.com/jcustenborder/kafka-connect-example</url>
<url>https://github.com/jcustenborder/kafka-connect-json-schema</url>
</scm>
<issueManagement>
<system>github</system>
<url>https://github.com/jcustenborder/kafka-connect-example/issues</url>
<url>https://github.com/jcustenborder/kafka-connect-json-schema/issues</url>
</issueManagement>
<dependencies/>
<dependencies>
<dependency>
<groupId>com.github.everit-org.json-schema</groupId>
<artifactId>org.everit.json.schema</artifactId>
<version>1.12.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
Expand All @@ -82,25 +94,28 @@
</executions>
</plugin>

<!--
Uncomment to prepare a package for the Confluent Hub.
<plugin>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-maven-plugin</artifactId>
<configuration>
<documentationUrl>
https://jcustenborder.github.io/kafka-connect-documentation/
</documentationUrl>
<confluentControlCenterIntegration>true</confluentControlCenterIntegration>
<documentationUrl>https://jcustenborder.github.io/kafka-connect-documentation/</documentationUrl>
<componentTypes>
<componentType>sink</componentType>
<componentType>transform</componentType>
<componentType>converter</componentType>
</componentTypes>
<tags>
<tag>Redis</tag>
<tag>Transform</tag>
<tag>FIX</tag>
</tags>
<title>Kafka Connect Redis</title>
<title>Kafka Connect JSON Schema Transformations</title>
<supportUrl>${pom.issueManagement.url}</supportUrl>
<supportSummary>Support provided through community involvement.</supportSummary>
<excludes>
<exclude>org.reflections:reflections</exclude>
</excludes>
</configuration>
</plugin>
-->
</plugins>
</build>
</project>
61 changes: 0 additions & 61 deletions src/main/connect-config-classes/BaseConnectorConfig.json

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/connect-config-classes/ExampleSinkConnectorConfig.json

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/connect-config-classes/ExampleSourceConnectorConfig.json

This file was deleted.

61 changes: 0 additions & 61 deletions src/main/connect-config-classes/ExampleTransformationConfig.json

This file was deleted.

Loading

0 comments on commit 16cf9b3

Please sign in to comment.