Skip to content

Commit 469477b

Browse files
authored
Confluent Hub Integration (#37)
* 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
1 parent 18cec35 commit 469477b

File tree

6 files changed

+88
-6
lines changed

6 files changed

+88
-6
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.idea
22
*.iml
3-
target/
3+
target/
4+
5+
.gradle/
6+
build/

assets/mongodb-leaf-only.png

11.5 KB
Loading

pom.xml

+81-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,41 @@
44

55
<groupId>at.grahsl.kafka.connect</groupId>
66
<artifactId>kafka-connect-mongodb</artifactId>
7-
<version>1.1.0-SNAPSHOT</version>
7+
<version>1.1.0</version>
88
<packaging>jar</packaging>
99

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

12+
<description>A Kafka connect MongoDB sink connector.</description>
13+
<url>https://github.com/hpgrahsl/kafka-connect-mongodb</url>
14+
<licenses>
15+
<license>
16+
<name>The Apache License, Version 2.0</name>
17+
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
18+
<distribution>repo</distribution>
19+
</license>
20+
</licenses>
21+
<inceptionYear>2017</inceptionYear>
22+
<developers>
23+
<developer>
24+
<name>Hans-Peter Grahsl</name>
25+
<email>[email protected]</email>
26+
<url>https://github.com/hpgrahsl</url>
27+
<roles>
28+
<role>maintainer</role>
29+
</roles>
30+
</developer>
31+
</developers>
32+
<scm>
33+
<connection>scm:git:https://github.com/hpgrahsl/kafka-connect-mongodb.git</connection>
34+
<developerConnection>scm:git:[email protected]:hpgrahsl/kafka-connect-mongodb.git</developerConnection>
35+
<url>https://github.com/hpgrahsl/kafka-connect-mongodb</url>
36+
</scm>
37+
<issueManagement>
38+
<system>github</system>
39+
<url>https://github.com/hpgrahsl/kafka-connect-mongodb/issues</url>
40+
</issueManagement>
41+
1242
<properties>
1343
<kafka.version>1.0.1</kafka.version>
1444
<junit.version>4.12</junit.version>
@@ -30,7 +60,9 @@
3060
<testcontainers.version>1.4.3</testcontainers.version>
3161
<avro.version>1.8.2</avro.version>
3262
<confluent.serializer.version>4.0.0</confluent.serializer.version>
63+
<confluent.connect.plugin.version>0.10.0</confluent.connect.plugin.version>
3364
<ok.http.version>3.9.1</ok.http.version>
65+
<yaml.beans.version>1.13</yaml.beans.version>
3466
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3567
</properties>
3668

@@ -55,6 +87,7 @@
5587
<groupId>com.github.jcustenborder.kafka.connect</groupId>
5688
<artifactId>connect-utils</artifactId>
5789
<version>[0.2.31,0.2.1000)</version>
90+
<scope>test</scope>
5891
</dependency>
5992
<dependency>
6093
<groupId>com.fasterxml.jackson.core</groupId>
@@ -71,6 +104,11 @@
71104
<artifactId>kafka-avro-serializer</artifactId>
72105
<version>${confluent.serializer.version}</version>
73106
</dependency>
107+
<dependency>
108+
<groupId>io.confluent</groupId>
109+
<artifactId>kafka-connect-maven-plugin</artifactId>
110+
<version>${confluent.connect.plugin.version}</version>
111+
</dependency>
74112
<dependency>
75113
<groupId>org.junit.jupiter</groupId>
76114
<artifactId>junit-jupiter-engine</artifactId>
@@ -146,7 +184,8 @@
146184
<dependency>
147185
<groupId>com.esotericsoftware.yamlbeans</groupId>
148186
<artifactId>yamlbeans</artifactId>
149-
<version>1.12</version>
187+
<version>${yaml.beans.version}</version>
188+
<scope>test</scope>
150189
</dependency>
151190
</dependencies>
152191

@@ -183,6 +222,7 @@
183222
<descriptorRefs>
184223
<descriptorRef>jar-with-dependencies</descriptorRef>
185224
</descriptorRefs>
225+
<outputDirectory>${basedir}/target/kafka-connect-mongodb/</outputDirectory>
186226
</configuration>
187227
<executions>
188228
<execution>
@@ -248,6 +288,45 @@
248288
</execution>
249289
</executions>
250290
</plugin>
291+
<plugin>
292+
<groupId>io.confluent</groupId>
293+
<artifactId>kafka-connect-maven-plugin</artifactId>
294+
<version>${confluent.connect.plugin.version}</version>
295+
<executions>
296+
<execution>
297+
<goals>
298+
<goal>kafka-connect</goal>
299+
</goals>
300+
<configuration>
301+
<title>Kafka Connect MongoDB Sink</title>
302+
<documentationUrl>https://github.com/hpgrahsl/kafka-connect-mongodb/blob/master/README.md</documentationUrl>
303+
<description>It's a basic Apache Kafka Connect SinkConnector which allows moving data from Kafka topics into MongoDB collections.</description>
304+
<logo>assets/mongodb-leaf-only.png</logo>
305+
<ownerUsername>hpgrahsl</ownerUsername>
306+
<ownerType>individual</ownerType>
307+
<ownerName>Hans-Peter Grahsl</ownerName>
308+
<ownerUrl>https://twitter.com/hpgrahsl</ownerUrl>
309+
<supportProviderName>Open Source Community</supportProviderName>
310+
<supportSummary>Support provided through community involvement.</supportSummary>
311+
<supportUrl>${pom.issueManagement.url}</supportUrl>
312+
<confluentControlCenterIntegration>true</confluentControlCenterIntegration>
313+
<componentTypes>
314+
<componentType>sink</componentType>
315+
</componentTypes>
316+
<tags>
317+
<tag>mongodb</tag>
318+
<tag>mongo</tag>
319+
<tag>nosql</tag>
320+
<tag>json</tag>
321+
<tag>bson</tag>
322+
<tag>documents</tag>
323+
<tag>humongous</tag>
324+
<tag>giantideas</tag>
325+
</tags>
326+
</configuration>
327+
</execution>
328+
</executions>
329+
</plugin>
251330
</plugins>
252331
<resources>
253332
<resource>

src/test/java/at/grahsl/kafka/connect/mongodb/MongoDbSinkConnectorConfigTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import at.grahsl.kafka.connect.mongodb.processor.field.renaming.RenameByRegExp;
2525
import com.github.jcustenborder.kafka.connect.utils.config.MarkdownFormatter;
2626
import com.mongodb.MongoClientURI;
27-
import org.apache.kafka.common.config.ConfigDef;
2827
import org.apache.kafka.common.config.ConfigException;
2928
import org.hamcrest.CoreMatchers;
3029
import org.hamcrest.Matchers;

src/test/java/at/grahsl/kafka/connect/mongodb/end2end/MinimumViableIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static void setup() throws IOException {
125125

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

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

131131
registerMongoDBSinkConnector(config);

src/test/resources/docker/compose-env.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ services:
5252
ports:
5353
- "8083:8083"
5454
volumes:
55-
- ../../../../target:/etc/kafka-connect/jars
55+
- ../../../../target/kafka-connect-mongodb/:/etc/kafka-connect/jars/kafka-connect-mongodb/
5656
environment:
5757
CONNECT_BOOTSTRAP_SERVERS: 'kafkabroker:9092'
5858
CONNECT_REST_ADVERTISED_HOST_NAME: kafkaconnect
@@ -72,3 +72,4 @@ services:
7272
CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
7373
CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
7474
CONNECT_ZOOKEEPER_CONNECT: 'zookeeper:2181'
75+
CONNECT_PLUGIN_PATH: '/usr/share/java,/etc/kafka-connect/jars'

0 commit comments

Comments
 (0)