Skip to content
Snippets Groups Projects
Commit 977ca62e authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

get duration_in_minutes as environment variable

parent e493642c
No related branches found
No related tags found
1 merge request!1Add Implementations of Use Cases
FROM openjdk:11-slim
ADD build/distributions/exp-bigdata19-bridge.tar /
CMD export JAVA_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=$LOG_LEVEL \
&& /exp-bigdata19-bridge/bin/exp-bigdata19-bridge
\ No newline at end of file
ADD build/distributions/uc3-application.tar /
CMD JAVA_OPTS="$JAVA_OPTS -Dorg.slf4j.simpleLogger.defaultLogLevel=$LOG_LEVEL" \
/uc3-application/bin/uc3-application
\ No newline at end of file
......@@ -21,7 +21,7 @@ dependencies {
testCompile 'junit:junit:4.12'
}
mainClassName = "titan.ccp.kiekerbridge.expbigdata19.ExperimentorBigData"
mainClassName = "uc3.application.HistoryService"
eclipse {
classpath {
......
package uc3.application;
import java.time.Duration;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import org.apache.commons.configuration2.Configuration;
import org.apache.kafka.streams.KafkaStreams;
......@@ -17,6 +18,8 @@ public class HistoryService {
private final Configuration config = Configurations.create();
private final CompletableFuture<Void> stopEvent = new CompletableFuture<>();
final int KAFKA_WINDOW_DURATION_MINUTES = Integer
.parseInt(Objects.requireNonNullElse(System.getenv("KAFKA_WINDOW_DURATION_MINUTES"), "60"));
/**
* Start the service.
......@@ -37,7 +40,7 @@ public class HistoryService {
.bootstrapServers(this.config.getString(ConfigurationKeys.KAFKA_BOOTSTRAP_SERVERS))
.inputTopic(this.config.getString(ConfigurationKeys.KAFKA_INPUT_TOPIC))
.outputTopic(this.config.getString(ConfigurationKeys.KAFKA_OUTPUT_TOPIC))
.windowDuration(Duration.ofMinutes(this.config.getInt(ConfigurationKeys.KAFKA_WINDOW_DURATION_MINUTES)))
.windowDuration(Duration.ofMinutes(this.KAFKA_WINDOW_DURATION_MINUTES))
.numThreads(this.config.getInt(ConfigurationKeys.NUM_THREADS))
.commitIntervalMs(this.config.getInt(ConfigurationKeys.COMMIT_INTERVAL_MS))
.cacheMaxBytesBuffering(this.config.getInt(ConfigurationKeys.CACHE_MAX_BYTES_BUFFERING)).build();
......
kafka.bootstrap.servers=localhost:9092
kafka.input.topic=input
kafka.output.topic=output
num.threads=1
commit.interval.ms=10
cache.max.bytes.buffering=-1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment