Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Try MT prefix on app id and client id.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffchao committed Nov 21, 2017
1 parent deaa798 commit 26999b5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion streams-aggregator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ run.doFirst {
environment "ADDON_SUFFIX", ""
environment "HEROKU_KAFKA_URL", "kafka://localhost:9092"
environment "HEROKU_POSTGRESQL_URL", "postgres://localhost:5432/kafka_streams_dev"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class AggregatorConfig extends Properties {
private static final String ADDON_SUFFIX = Optional.ofNullable(
System.getenv("ADDON_SUFFIX")).orElse("");
private static final String HEROKU_KAFKA = String.format("HEROKU_KAFKA%s", ADDON_SUFFIX);
private static final String HEROKU_KAFKA_PREFIX = Optional.ofNullable(
System.getenv(String.format("%s_PREFIX", HEROKU_KAFKA))).orElse("");
private static final String HEROKU_KAFKA_URL = String.format("%s_URL", HEROKU_KAFKA);
private static final String HEROKU_KAFKA_TRUSTED_CERT =
String.format("%s_TRUSTED_CERT", HEROKU_KAFKA);
Expand Down Expand Up @@ -106,8 +108,10 @@ private Properties buildHerokuKafkaConfigVars() throws URISyntaxException, Certi

private Properties buildKafkaStreamsDefaults() {
Properties properties = new Properties();
properties.put(StreamsConfig.APPLICATION_ID_CONFIG, "aggregator-app");
properties.put(StreamsConfig.CLIENT_ID_CONFIG, "aggregator-client");
properties.put(StreamsConfig.APPLICATION_ID_CONFIG,
String.format("%saggregator-app", HEROKU_KAFKA_PREFIX));
properties.put(StreamsConfig.CLIENT_ID_CONFIG,
String.format("%saggregator-client", HEROKU_KAFKA_PREFIX));
properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
properties.put(
StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class AnomalyCheckerConfig extends Properties {
private static final String ADDON_SUFFIX = Optional.ofNullable(
System.getenv("ADDON_SUFFIX")).orElse("");
private static final String HEROKU_KAFKA = String.format("HEROKU_KAFKA%s", ADDON_SUFFIX);
private static final String HEROKU_KAFKA_PREFIX = Optional.ofNullable(
System.getenv(String.format("%s_PREFIX", HEROKU_KAFKA))).orElse("");
private static final String HEROKU_KAFKA_URL = String.format("%s_URL", HEROKU_KAFKA);
private static final String HEROKU_KAFKA_TRUSTED_CERT =
String.format("%s_TRUSTED_CERT", HEROKU_KAFKA);
Expand Down Expand Up @@ -106,8 +108,10 @@ private Properties buildHerokuKafkaConfigVars() throws URISyntaxException, Certi

private Properties buildKafkaStreamsDefaults() {
Properties properties = new Properties();
properties.put(StreamsConfig.APPLICATION_ID_CONFIG, "anomaly-checker-app");
properties.put(StreamsConfig.CLIENT_ID_CONFIG, "anomaly-checker-client");
properties.put(StreamsConfig.APPLICATION_ID_CONFIG,
String.format("%sanomaly-checker-app", HEROKU_KAFKA_PREFIX));
properties.put(StreamsConfig.CLIENT_ID_CONFIG,
String.format("%sanomaly-checker-client", HEROKU_KAFKA_PREFIX));
properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
properties.put(
StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class TextProcessorConfig extends Properties {
private static final String ADDON_SUFFIX = Optional.ofNullable(
System.getenv("ADDON_SUFFIX")).orElse("");
private static final String HEROKU_KAFKA = String.format("HEROKU_KAFKA%s", ADDON_SUFFIX);
private static final String HEROKU_KAFKA_PREFIX = Optional.ofNullable(
System.getenv(String.format("%s_PREFIX", HEROKU_KAFKA))).orElse("");
private static final String HEROKU_KAFKA_URL = String.format("%s_URL", HEROKU_KAFKA);
private static final String HEROKU_KAFKA_TRUSTED_CERT =
String.format("%s_TRUSTED_CERT", HEROKU_KAFKA);
Expand Down Expand Up @@ -106,8 +108,10 @@ private Properties buildHerokuKafkaConfigVars() throws URISyntaxException, Certi

private Properties buildKafkaStreamsDefaults() {
Properties properties = new Properties();
properties.put(StreamsConfig.APPLICATION_ID_CONFIG, "text-processor-app");
properties.put(StreamsConfig.CLIENT_ID_CONFIG, "text-processor-client");
properties.put(StreamsConfig.APPLICATION_ID_CONFIG,
String.format("%stext-processor-app", HEROKU_KAFKA_PREFIX));
properties.put(StreamsConfig.CLIENT_ID_CONFIG,
String.format("%stext-processor-client", HEROKU_KAFKA_PREFIX));
properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
properties.put(
StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG,
Expand Down

0 comments on commit 26999b5

Please sign in to comment.