diff --git a/src/main/resources/META-INF/maven/archetype.xml b/src/main/resources/META-INF/maven/archetype.xml index df04c97..0afa655 100644 --- a/src/main/resources/META-INF/maven/archetype.xml +++ b/src/main/resources/META-INF/maven/archetype.xml @@ -16,6 +16,11 @@ config/MySinkConnector.properties config/MySourceConnector.properties README.md + docker-compose.yml + connect/connect-avro-docker.properties + bin/debug.sh + bin/suspend.sh + src/test/resources/logback.xml src/test/java/MySinkConnectorConfigTest.java diff --git a/src/main/resources/archetype-resources/bin/debug.sh b/src/main/resources/archetype-resources/bin/debug.sh new file mode 100755 index 0000000..6a49aa4 --- /dev/null +++ b/src/main/resources/archetype-resources/bin/debug.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2016 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. +# 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. +# + +mvn clean package + +export CLASSPATH="$(find `pwd`/target/kafka-*-package/share/java/ -type f -name '*.jar' | tr '\n' ':')" + +$CONFLUENT_HOME/bin/connect-standalone connect/connect-avro-docker.properties config/MySinkConnector.properties config/MySourceConnector.properties \ No newline at end of file diff --git a/src/main/resources/archetype-resources/bin/suspend.sh b/src/main/resources/archetype-resources/bin/suspend.sh new file mode 100755 index 0000000..ef5987b --- /dev/null +++ b/src/main/resources/archetype-resources/bin/suspend.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2016 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. +# 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. +# + +mvn clean package + +export KAFKA_JMX_OPTS='-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005' +export CLASSPATH="$(find `pwd`/target/kafka-*-package/share/java/ -type f -name '*.jar' | tr '\n' ':')" + +$CONFLUENT_HOME/bin/connect-standalone connect/connect-avro-docker.properties config/MySinkConnector.properties config/MySourceConnector.properties \ No newline at end of file diff --git a/src/main/resources/archetype-resources/connect/connect-avro-docker.properties b/src/main/resources/archetype-resources/connect/connect-avro-docker.properties new file mode 100644 index 0000000..d2ea3de --- /dev/null +++ b/src/main/resources/archetype-resources/connect/connect-avro-docker.properties @@ -0,0 +1,25 @@ +# Sample configuration for a standalone Kafka Connect worker that uses Avro serialization and +# integrates the the SchemaConfig Registry. This sample configuration assumes a local installation of +# Confluent Platform with all services running on their default ports. +# Bootstrap Kafka servers. If multiple servers are specified, they should be comma-separated. +bootstrap.servers=confluent:9092 +# The converters specify the format of data in Kafka and how to translate it into Connect data. +# Every Connect user will need to configure these based on the format they want their data in +# when loaded from or stored into Kafka +key.converter=io.confluent.connect.avro.AvroConverter +key.converter.schema.registry.url=http://confluent:8081 +value.converter=io.confluent.connect.avro.AvroConverter +value.converter.schema.registry.url=http://confluent:8081 +# The internal converter used for offsets and config data is configurable and must be specified, +# but most users will always want to use the built-in default. Offset and config data is never +# visible outside of Connect in this format. +internal.key.converter=org.apache.kafka.connect.json.JsonConverter +internal.value.converter=org.apache.kafka.connect.json.JsonConverter +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 diff --git a/src/main/resources/archetype-resources/docker-compose.yml b/src/main/resources/archetype-resources/docker-compose.yml new file mode 100644 index 0000000..7dcf3d2 --- /dev/null +++ b/src/main/resources/archetype-resources/docker-compose.yml @@ -0,0 +1,28 @@ +version: "2" +services: + zookeeper: + image: confluent/zookeeper + ports: + - "2181:2181" + environment: + zk_id: "1" + network_mode: "host" + kafka: + image: confluent/kafka + depends_on: + - zookeeper + ports: + - "9092:9092" + environment: + KAFKA_ZOOKEEPER_CONNECT: "confluent:2181" + network_mode: "host" + schema-registry: + image: confluent/schema-registry + depends_on: + - kafka + - zookeeper + ports: + - "8081:8081" + environment: + SR_KAFKASTORE_CONNECTION_URL: "confluent:2181" + network_mode: "host" \ No newline at end of file diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index aa5572f..73f45b5 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -8,12 +8,19 @@ jar ${artifactId} + A Kafka Connect Connector for ${artifactId} 0.10.0.0-cp1 - 4.12 + + + confluent + http://packages.confluent.io/maven/ + + + org.apache.kafka @@ -24,7 +31,19 @@ junit junit - ${junit.version} + 4.12 + test + + + org.mockito + mockito-core + 1.10.19 + test + + + ch.qos.logback + logback-classic + 1.1.7 test @@ -79,10 +98,4 @@ - - - confluent - http://packages.confluent.io/maven/ - - \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/logback.xml b/src/main/resources/archetype-resources/src/test/resources/logback.xml new file mode 100644 index 0000000..ffe34f9 --- /dev/null +++ b/src/main/resources/archetype-resources/src/test/resources/logback.xml @@ -0,0 +1,10 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + \ No newline at end of file