Skip to content

Commit

Permalink
Merge pull request #1 from kaazing/kafka-load-generator
Browse files Browse the repository at this point in the history
Kafka load generator
  • Loading branch information
sidda-at-kaazing authored Feb 28, 2018
2 parents e239ec8 + 98eb5a0 commit 1fdd08d
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 18 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM maven:3.5.2-jdk-8

ENV KAFKA_BOOTSTRAP_SERVERS kafka:9092

# Define working directory.
ARG WORKDIR=/opt/kafkaloadgenerator
RUN mkdir $WORKDIR -p
WORKDIR $WORKDIR

# Build kafka-streams
RUN mkdir -p config
RUN mkdir -p data
COPY target/kafka-load-generator-0.0.1-SNAPSHOT-jar-with-dependencies.jar $WORKDIR
COPY config/* $WORKDIR/config/
COPY data/* $WORKDIR/data/

ENTRYPOINT java -Dconfig=./config -jar kafka-load-generator-0.0.1-SNAPSHOT-jar-with-dependencies.jar ./config/kafkaclient.properties

10 changes: 9 additions & 1 deletion src/main/java/com/lc/df/kafka/client/KafkaClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ public void init() {
}
max_records_per_file = Long.valueOf(maxRec).longValue();

kafka_bootstrap_servers = prop.getProperty("kafka.bootstrap.servers");
// Use bootstrap server info from the environment var if available
kafka_bootstrap_servers = System.getenv("KAFKA_BOOTSTRAP_SERVERS");
if (kafka_bootstrap_servers != null) {
System.out.printf("Overriding bootstrap.servers: %s\n", kafka_bootstrap_servers );
}
else {
kafka_bootstrap_servers = prop.getProperty("kafka.bootstrap.servers");
}

kafka_topic = prop.getProperty("kafka.topic");
kafka_compressiontype = prop.getProperty("kafka.compressiontype");
kafka_listener_groupName = prop.getProperty("kafka.listener.groupName");
Expand Down
Binary file modified target/classes/com/lc/df/kafka/client/KafkaClientConfig.class
Binary file not shown.
Binary file modified target/classes/com/lc/df/kafka/client/Kpi.class
Binary file not shown.
Binary file modified target/classes/com/lc/df/kafka/client/Report.class
Binary file not shown.
Binary file modified target/classes/com/lc/df/kafka/client/ReportHtml.class
Binary file not shown.
Binary file modified target/classes/com/lc/df/kafka/client/Utils.class
Binary file not shown.
Binary file not shown.
Binary file modified target/kafka-load-generator-0.0.1-SNAPSHOT.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven
#Thu Feb 22 22:53:16 GMT 2018
#Tue Feb 27 16:31:21 PST 2018
version=0.0.1-SNAPSHOT
groupId=com.lc.df.kafka
artifactId=kafka-load-generator
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ com/lc/df/kafka/client/KafkaMsgSender.class
com/lc/df/kafka/client/Logger.class
com/lc/df/kafka/client/KafkaMsgConsumer.class
com/lc/df/kafka/client/ReportHtml.class
com/lc/df/kafka/client/Utils.class
com/lc/df/kafka/client/KafkaClient$1.class
com/lc/df/kafka/client/Utils.class
com/lc/df/kafka/client/KafkaClientConfig.class
com/lc/df/kafka/test/KafkaTest$1.class
com/lc/df/kafka/client/KafkaClient$2.class
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/test/KafkaTest.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Logger.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/ReportHtml.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaMsgSender.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClientResponseHandler.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaMsgConsumer.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Kpi.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClientConfig.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/TransactionContext.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Utils.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaPayload.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/PayloadConfig.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Report.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClient.java
/Users/anandgopalratnam/Documents/Data-Fabric/GIT/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClientStats.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/test/KafkaTest.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaPayload.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/ReportHtml.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClientStats.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClientConfig.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Utils.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Report.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClient.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/PayloadConfig.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaMsgSender.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/TransactionContext.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaClientResponseHandler.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/KafkaMsgConsumer.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Logger.java
/Users/sidda/dev/KafkaLoadGenerator/src/main/java/com/lc/df/kafka/client/Kpi.java
Empty file.

0 comments on commit 1fdd08d

Please sign in to comment.