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

clean up

parent 26c2c743
No related branches found
No related tags found
1 merge request!1Add Implementations of Use Cases
......@@ -18,6 +18,7 @@ public class TopologyBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(TopologyBuilder.class);
private final String inputTopic;
private final Gson gson;
private final StreamsBuilder builder = new StreamsBuilder();
......@@ -26,18 +27,18 @@ public class TopologyBuilder {
*/
public TopologyBuilder(final String inputTopic) {
this.inputTopic = inputTopic;
this.gson = new Gson();
}
/**
* Build the {@link Topology} for the History microservice.
*/
public Topology build() {
final Gson gson = new Gson();
this.builder
.stream(this.inputTopic,
Consumed.with(Serdes.String(), IMonitoringRecordSerde.serde(new ActivePowerRecordFactory())))
.mapValues(v -> gson.toJson(v)).foreach((k, v) -> LOGGER.info("Key: " + k + " Value: " + v));
.mapValues(v -> this.gson.toJson(v)).foreach((k, v) -> LOGGER.info("Key: " + k + " Value: " + v));
return this.builder.build();
}
......
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