Skip to content

Commit

Permalink
Confluent Hub Integration (#37)
Browse files Browse the repository at this point in the history
* add gradle specifics to ignore file

* integrate with confluent's connect hub maven plugin

* changes to have CP isolation for connect docker image

* confluent hub release preparation
  • Loading branch information
hpgrahsl authored May 19, 2018
1 parent 18cec35 commit 469477b
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea
*.iml
target/
target/

.gradle/
build/
Binary file added assets/mongodb-leaf-only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 81 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,41 @@

<groupId>at.grahsl.kafka.connect</groupId>
<artifactId>kafka-connect-mongodb</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
<packaging>jar</packaging>

<name>kafka-connect-mongodb</name>

<description>A Kafka connect MongoDB sink connector.</description>
<url>https://github.com/hpgrahsl/kafka-connect-mongodb</url>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<inceptionYear>2017</inceptionYear>
<developers>
<developer>
<name>Hans-Peter Grahsl</name>
<email>[email protected]</email>
<url>https://github.com/hpgrahsl</url>
<roles>
<role>maintainer</role>
</roles>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/hpgrahsl/kafka-connect-mongodb.git</connection>
<developerConnection>scm:git:[email protected]:hpgrahsl/kafka-connect-mongodb.git</developerConnection>
<url>https://github.com/hpgrahsl/kafka-connect-mongodb</url>
</scm>
<issueManagement>
<system>github</system>
<url>https://github.com/hpgrahsl/kafka-connect-mongodb/issues</url>
</issueManagement>

<properties>
<kafka.version>1.0.1</kafka.version>
<junit.version>4.12</junit.version>
Expand All @@ -30,7 +60,9 @@
<testcontainers.version>1.4.3</testcontainers.version>
<avro.version>1.8.2</avro.version>
<confluent.serializer.version>4.0.0</confluent.serializer.version>
<confluent.connect.plugin.version>0.10.0</confluent.connect.plugin.version>
<ok.http.version>3.9.1</ok.http.version>
<yaml.beans.version>1.13</yaml.beans.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -55,6 +87,7 @@
<groupId>com.github.jcustenborder.kafka.connect</groupId>
<artifactId>connect-utils</artifactId>
<version>[0.2.31,0.2.1000)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand All @@ -71,6 +104,11 @@
<artifactId>kafka-avro-serializer</artifactId>
<version>${confluent.serializer.version}</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-maven-plugin</artifactId>
<version>${confluent.connect.plugin.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down Expand Up @@ -146,7 +184,8 @@
<dependency>
<groupId>com.esotericsoftware.yamlbeans</groupId>
<artifactId>yamlbeans</artifactId>
<version>1.12</version>
<version>${yaml.beans.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down Expand Up @@ -183,6 +222,7 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>${basedir}/target/kafka-connect-mongodb/</outputDirectory>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -248,6 +288,45 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-maven-plugin</artifactId>
<version>${confluent.connect.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>kafka-connect</goal>
</goals>
<configuration>
<title>Kafka Connect MongoDB Sink</title>
<documentationUrl>https://github.com/hpgrahsl/kafka-connect-mongodb/blob/master/README.md</documentationUrl>
<description>It's a basic Apache Kafka Connect SinkConnector which allows moving data from Kafka topics into MongoDB collections.</description>
<logo>assets/mongodb-leaf-only.png</logo>
<ownerUsername>hpgrahsl</ownerUsername>
<ownerType>individual</ownerType>
<ownerName>Hans-Peter Grahsl</ownerName>
<ownerUrl>https://twitter.com/hpgrahsl</ownerUrl>
<supportProviderName>Open Source Community</supportProviderName>
<supportSummary>Support provided through community involvement.</supportSummary>
<supportUrl>${pom.issueManagement.url}</supportUrl>
<confluentControlCenterIntegration>true</confluentControlCenterIntegration>
<componentTypes>
<componentType>sink</componentType>
</componentTypes>
<tags>
<tag>mongodb</tag>
<tag>mongo</tag>
<tag>nosql</tag>
<tag>json</tag>
<tag>bson</tag>
<tag>documents</tag>
<tag>humongous</tag>
<tag>giantideas</tag>
</tags>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import at.grahsl.kafka.connect.mongodb.processor.field.renaming.RenameByRegExp;
import com.github.jcustenborder.kafka.connect.utils.config.MarkdownFormatter;
import com.mongodb.MongoClientURI;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.common.config.ConfigException;
import org.hamcrest.CoreMatchers;
import org.hamcrest.Matchers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static void setup() throws IOException {

String config = new String(Files.readAllBytes(Paths.get(SINK_CONNECTOR_CONFIG)));

deferExecutionToWaitForDataPropagation(Duration.ofMinutes(3),
deferExecutionToWaitForDataPropagation(Duration.ofMinutes(2),
"wait some time so that all container processes become available");

registerMongoDBSinkConnector(config);
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/docker/compose-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
ports:
- "8083:8083"
volumes:
- ../../../../target:/etc/kafka-connect/jars
- ../../../../target/kafka-connect-mongodb/:/etc/kafka-connect/jars/kafka-connect-mongodb/
environment:
CONNECT_BOOTSTRAP_SERVERS: 'kafkabroker:9092'
CONNECT_REST_ADVERTISED_HOST_NAME: kafkaconnect
Expand All @@ -72,3 +72,4 @@ services:
CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_ZOOKEEPER_CONNECT: 'zookeeper:2181'
CONNECT_PLUGIN_PATH: '/usr/share/java,/etc/kafka-connect/jars'

0 comments on commit 469477b

Please sign in to comment.