Skip to content

Commit

Permalink
Moved to common debug script. Updated docker-compose to the latest im…
Browse files Browse the repository at this point in the history
…ages. Updated documentation.
  • Loading branch information
jcustenborder committed Jan 22, 2017
1 parent 372f6ca commit 08f8e04
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 169 deletions.
24 changes: 3 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#!groovy
node {
def mvnBuildNumber = "0.1.${env.BUILD_NUMBER}"
@Library('jenkins-pipeline') import com.github.jcustenborder.jenkins.pipeline.KafkaConnectPipeline

def mvnHome = tool 'M3'

checkout scm

if (env.BRANCH_NAME == 'master') {
stage 'versioning'
sh "${mvnHome}/bin/mvn -B versions:set -DgenerateBackupPoms=false -DnewVersion=${mvnBuildNumber}"
}

stage 'build'
sh "${mvnHome}/bin/mvn -B -P maven-central clean verify package"

junit '**/target/surefire-reports/TEST-*.xml'

if (env.BRANCH_NAME == 'master') {
stage 'publishing'
sh "${mvnHome}/bin/mvn -B -P github,maven-central deploy"
}
}
def pipe = new KafkaConnectPipeline()
pipe.execute()
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ it will sit behind a load balancer nicely.
```
name=splunk-http-source
tasks.max=1
connector.class=io.confluent.kafka.connect.splunk.SplunkHttpSourceConnector
connector.class=com.github.jcustenborder.kafka.connect.splunk.SplunkHttpSourceConnector
splunk.ssl.key.store.path=/etc/security/keystore.jks
splunk.ssl.key.store.password=password
splunk.collector.index.default=main
Expand Down Expand Up @@ -60,7 +60,7 @@ This configuration will write to Splunk over SSL but will not verify the certifi
name=splunk-http-sink
topics=syslog-udp
tasks.max=1
connector.class=io.confluent.kafka.connect.splunk.SplunkHttpSinkConnector
connector.class=com.github.jcustenborder.kafka.connect.splunk.SplunkHttpSinkConnector
splunk.remote.host=192.168.99.100
splunk.remote.port=8088
splunk.ssl.enabled=true
Expand All @@ -80,7 +80,7 @@ object.

Here is an example of an event generated by [Kafka Connect Syslog](https://github.com/jcustenborder/kafka-connect-syslog) written to Splunk.

```
```json
{
"host": "vpn.example.com",
"time": 1472342182,
Expand All @@ -96,8 +96,15 @@ Here is an example of an event generated by [Kafka Connect Syslog](https://githu

# Running in development

## Run the connector

```bash
./bin/debug.sh
```
mvn clean package
export CLASSPATH="$(find target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
$CONFLUENT_HOME/bin/connect-standalone $CONFLUENT_HOME/etc/schema-registry/connect-avro-standalone.properties config/MySourceConnector.properties
```

## Suspend waiting on the debugger to attach.

```bash
export SUSPEND='y'
./bin/debug.sh
```
17 changes: 6 additions & 11 deletions bin/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
# limitations under the License.
#

mvn clean package
: ${SUSPEND:='n'}

if [ $? -eq 0 ]
then
echo "maven finished"
else
echo "Maven failed"
exit 1
fi
set -e

export CLASSPATH="$(find target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
export KAFKA_JMX_OPTS='-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
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/share/java -type f -name '*.jar' | tr '\n' ':')"

$CONFLUENT_HOME/bin/connect-standalone connect/connect-avro-docker.properties config/SplunkHttpSource.properties config/SplunkHttpSink.properties
$CONFLUENT_HOME/bin/connect-standalone
31 changes: 0 additions & 31 deletions bin/suspend.sh

This file was deleted.

86 changes: 0 additions & 86 deletions checkstyle/checkstyle.xml

This file was deleted.

File renamed without changes.
25 changes: 12 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright © 2016 Jeremy Custenborder (jcustenborder@gmail.com)
# Copyright © 2017 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,31 +17,30 @@
version: "2"
services:
zookeeper:
image: confluent/zookeeper
ports:
- "2181:2181"
image: confluentinc/cp-zookeeper:3.1.1-1
environment:
ZOOKEEPER_CLIENT_PORT: 2181
zk_id: "1"
network_mode: "host"
kafka:
image: confluent/kafka
depends_on:
hostname: kafka
image: confluentinc/cp-kafka:3.1.1-1
links:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ZOOKEEPER_CONNECT: "confluent:2181"
network_mode: "host"
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://:9092"
schema-registry:
image: confluent/schema-registry
depends_on:
image: confluentinc/cp-schema-registry:3.1.1-1
links:
- kafka
- zookeeper
ports:
- "8081:8081"
environment:
SR_KAFKASTORE_CONNECTION_URL: "confluent:2181"
network_mode: "host"
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"
SCHEMA_REGISTRY_HOST_NAME: schema-registry
splunk:
image: outcoldman/splunk:latest
environment:
Expand Down

0 comments on commit 08f8e04

Please # to comment.