Skip to content

Commit

Permalink
Pass environment variable for the broker
Browse files Browse the repository at this point in the history
  • Loading branch information
sidda-at-kaazing committed Feb 28, 2018
1 parent f87372a commit 98eb5a0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
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 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
#Mon Feb 26 13:27:34 PST 2018
#Tue Feb 27 16:31:21 PST 2018
version=0.0.1-SNAPSHOT
groupId=com.lc.df.kafka
artifactId=kafka-load-generator

0 comments on commit 98eb5a0

Please sign in to comment.