Skip to content

Commit

Permalink
Moved to version 2.0.0-cp1. Fixes #7.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcustenborder committed Aug 23, 2018
1 parent 839d009 commit b42c393
Show file tree
Hide file tree
Showing 27 changed files with 303 additions and 191 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
This maven quickstart is used to generate a skeleton plugin for Kafka Connect.
![Maven Central](https://img.shields.io/maven-central/v/com.github.jcustenborder.kafka.connect/kafka-connect-quickstart.svg)

This maven quickstart is used to generate a skeleton plugin for Kafka Connect. Look
[here](https://search.maven.org/search?q=g:com.github.jcustenborder.kafka.connect%20AND%20a:kafka-connect-quickstart&core=gav)
for a list of available versions.


```
mvn archetype:generate -DarchetypeGroupId=com.github.jcustenborder.kafka.connect -DarchetypeArtifactId=kafka-connect-quickstart -DarchetypeVersion=0.10.2.1-cp2
mvn archetype:generate \
-DarchetypeGroupId=com.github.jcustenborder.kafka.connect \
-DarchetypeArtifactId=kafka-connect-quickstart \
-DarchetypeVersion=2.0.0-cp1
```

```
mvn archetype:generate -DarchetypeGroupId=com.github.jcustenborder.kafka.connect -DarchetypeArtifactId=kafka-connect-quickstart -DarchetypeVersion=0.10.2.1-cp2 -Dpackage=io.confluent.examples -DgroupId=io.confluent.examples -DartifactId=testconnect -DpackageName=io.confluent.examples -Dversion=1.0-SNAPSHOT
mvn archetype:generate \
-DarchetypeGroupId=com.github.jcustenborder.kafka.connect \
-DarchetypeArtifactId=kafka-connect-quickstart \
-DarchetypeVersion=2.0.0-cp1 \
-Dpackage=com.github.jcustenborder.kafka.connect.test \
-DgroupId=com.github.jcustenborder.kafka.connect \
-DartifactId=testconnect \
-DpackageName=com.github.jcustenborder.kafka.connect.test \
-Dversion=1.0-SNAPSHOT
```

See https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22kafka-connect-quickstart%22 for a list of available archetypes
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.github.jcustenborder.kafka.connect</groupId>
<artifactId>kafka-connect-quickstart</artifactId>
<version>0.11.0.0-cp1</version>
<version>2.0.0-cp1</version>
<name>kafka-connect-archtype</name>
<description>A quickstart for building Kafka Connect connectors.</description>
<url>https://github.com/jcustenborder/kafka-connect-archtype</url>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/maven/archetype.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<source>src/main/java/MySinkTask.java</source>
<source>src/main/java/MySinkConnector.java</source>
<source>src/main/java/MySinkConnectorConfig.java</source>
<source>src/main/java/VersionUtil.java</source>
</sources>
<resources>
<resource>src/main/assembly/package.xml</resource>
Expand All @@ -22,11 +21,12 @@
<resource>src/test/resources/logback.xml</resource>
</resources>
<testSources>
<source>src/test/java/MySinkConnectorConfigTest.java</source>
<source>src/test/java/MySinkConnectorTest.java</source>
<source>src/test/java/MySinkTaskTest.java</source>
<source>src/test/java/MySourceConnectorConfigTest.java</source>
<source>src/test/java/MySinkTaskIT.java</source>
<source>src/test/java/MySourceConnectorTest.java</source>
<source>src/test/java/MySourceTaskTest.java</source>
<source>src/test/java/MySourceTaskIT.java</source>
<source>src/test/java/DocumentationTest.java</source>
</testSources>
</archetype>
19 changes: 15 additions & 4 deletions src/main/resources/archetype-resources/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Introduction

Welcome to your new Kafka Connect connector!

# Running in development

## Configuring Docker

The [docker-compose.yml](docker-compose.yml) that is included in this repository is based on the Confluent Platform Docker
images. Take a look at the [quickstart](http://docs.confluent.io/3.0.1/cp-docker-images/docs/quickstart.html#getting-started-with-docker-client)
images. Take a look at the [quickstart](http://docs.confluent.io/current/cp-docker-images/docs/quickstart.html#getting-started-with-docker-client)
for the Docker images.

The hostname `confluent` must be resolvable by your host. You will need to determine the ip address of your docker-machine using `docker-machine ip confluent`
and add this to your `/etc/hosts` file. For example if `docker-machine ip confluent` returns `192.168.99.100` add this:
Your development workstation needs to be able to resolve the hostnames that are listed in the `docker-compose.yml`
file in the root of this repository. If you are using [Docker for Mac](https://docs.docker.com/v17.12/docker-for-mac/install/)
your containers will be available at the ip address `127.0.0.1`. If you are running docker-machine
you will need to determine the ip address of the virtual machine with `docker-machine ip confluent`
to determine the ip address.

```
192.168.99.100 confluent
127.0.0.1 zookeeper
127.0.0.1 kafka
127.0.0.1 schema-registry
```

## Start Docker
Expand All @@ -23,6 +30,10 @@ docker-compose up -d

## Starting your connector

The debug script assumes that `connect-standalone` is in the path on your local workstation. Download
the latest version of the [Kafka](https://www.confluent.io/download/) to get started.


Start the connector with debugging enabled.

```
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/archetype-resources/bin/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set -e

mvn clean package
export KAFKA_JMX_OPTS="-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=${SUSPEND},address=5005"
export CLASSPATH="$(find target/kafka-connect-target/usr/share/java -type f -name '*.jar' | tr '\n' ':')"

connect-standalone config/connect-avro-docker.properties config/MySinkConnector.properties config/MySourceConnector.properties
]]#
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ internal.key.converter.schemas.enable=false
internal.value.converter.schemas.enable=false
# Local storage file for offset data
offset.storage.file.filename=/tmp/connect.offsets

# Confuent Control Center Integration -- uncomment these lines to enable Kafka client interceptors
# that will report audit data that can be displayed and analyzed in Confluent Control Center
# producer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor
# consumer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor

# Load our plugin from the output path.
plugin.path=target/kafka-connect-target
54 changes: 45 additions & 9 deletions src/main/resources/archetype-resources/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,63 @@
#
# Copyright © 2017 Jeremy Custenborder ([email protected])
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

version: "2"
services:
zookeeper:
image: confluentinc/cp-zookeeper:3.2.2-1
image: confluentinc/cp-zookeeper:5.0.0
environment:
ZOOKEEPER_CLIENT_PORT: 2181
zk_id: "1"
ports:
- "2181:2181"
kafka:
hostname: kafka
image: confluentinc/cp-kafka:3.2.2-1
image: confluentinc/cp-enterprise-kafka:5.0.0
links:
- zookeeper
- zookeeper
ports:
- "9092:9092"
- "9092:9092"
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://:9092"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
schema-registry:
image: confluentinc/cp-schema-registry:3.2.2-1
image: confluentinc/cp-schema-registry:5.0.0
links:
- kafka
- zookeeper
- kafka
- zookeeper
ports:
- "8081:8081"
- "8081:8081"
environment:
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_HOST_NAME: schema-registry
control-center:
image: confluentinc/cp-enterprise-control-center:5.0.0
depends_on:
- zookeeper
- kafka
- schema-registry
ports:
- "9021:9021"
environment:
CONTROL_CENTER_BOOTSTRAP_SERVERS: "kafka:9092"
CONTROL_CENTER_ZOOKEEPER_CONNECT: "zookeeper:2181"
CONTROL_CENTER_CONNECT_CLUSTER: 'connect:8083'
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_CONFLUENT_CONTROLCENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
98 changes: 20 additions & 78 deletions src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand All @@ -10,92 +11,33 @@
<name>${artifactId}</name>
<description>A Kafka Connect Connector for ${artifactId}</description>

<properties>
<kafka.version>0.11.0.0-cp1</kafka.version>
</properties>
<parent>
<groupId>com.github.jcustenborder.kafka.connect</groupId>
<artifactId>kafka-connect-parent</artifactId>
<version>2.0.0-cp1</version>
</parent>

<repositories>
<repository>
<id>confluent</id>
<url>http://packages.confluent.io/maven/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-api</artifactId>
<version>${kafka.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<scm>
<connection></connection>
<developerConnection></developerConnection>
<url></url>
</scm>
<issueManagement>
<system></system>
<url></url>
</issueManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>


</project>
Loading

0 comments on commit b42c393

Please sign in to comment.