Skip to content

Commit

Permalink
Merge pull request #16 from sve2-2020ss/documentation
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
alexdoppel authored Apr 29, 2020
2 parents dc67950 + e52f835 commit 85d6706
Show file tree
Hide file tree
Showing 29 changed files with 2,432 additions and 252 deletions.
1,106 changes: 1,105 additions & 1 deletion README.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions _docker/runCollectors.bash

This file was deleted.

20 changes: 20 additions & 0 deletions _docker/runCommandsScalingTest.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Collector services
java -Dquarkus.http.port=8085 -Dmp.messaging.incoming.mqtt-sensor-data.port=1883 -Dmp.messaging.incoming.mqtt-sensor-data.client-id=eu.collector.mqtt -Dmp.messaging.outgoing.amqp-measurement-records.containerId=eu.collector -jar collector.jar
java -Dquarkus.http.port=8086 -Dmp.messaging.incoming.mqtt-sensor-data.port=1884 -Dmp.messaging.incoming.mqtt-sensor-data.client-id=us.collector.mqtt -Dmp.messaging.outgoing.amqp-measurement-records.containerId=us.collector -jar collector.jar
java -Dquarkus.http.port=8087 -Dmp.messaging.incoming.mqtt-sensor-data.port=1885 -Dmp.messaging.incoming.mqtt-sensor-data.client-id=ca.collector.mqtt -Dmp.messaging.outgoing.amqp-measurement-records.containerId=ca.collector -jar collector.jar

# Web frontend services
java -Dquarkus.http.port=8080 -Dmp.messaging.incoming.measurement-records.containerId=frontend.charlie -jar frontend.jar
java -Dquarkus.http.port=8081 -Dmp.messaging.incoming.measurement-records.containerId=frontend.delta -jar frontend.jar

# Persistence services
java -jar persist.jar
java -jar persist.jar

# Dashboard
bokeh serve --show main.py

# Weather station simulators
java -jar stationSimulator-0.jar 0 127.0.0.1 1883
java -jar stationSimulator-0.jar 3 127.0.0.1 1884
java -jar stationSimulator-0.jar 6 127.0.0.1 1885
2 changes: 1 addition & 1 deletion dashboard/amqp/WeatherRecordReceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def on_start(self, event):
)

def on_message(self, event):
weather_record_dto = create_weather_record_dto_from_json(event.message.body.decode("utf-8"))
weather_record_dto = create_weather_record_dto_from_json(event.message.body)
self.received += 1
if weather_record_dto.weather_station_id == self.weather_station_id:
self.record_received_callback(weather_record_dto)
2 changes: 1 addition & 1 deletion dashboard/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

plot = figure(
title = "Dashboard for weather station #" + os.getenv('WEATHER_STATION_ID'),
plot_height = 500,
plot_width = 1280,
tools="xpan,xwheel_zoom,xbox_zoom,reset",
x_axis_type = 'datetime'
)
Expand Down
Binary file modified doc/architecture.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,296 changes: 1,110 additions & 186 deletions doc/architecture.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/architecture.vsdx
Binary file not shown.
File renamed without changes
File renamed without changes.
Binary file added doc/architecture_alpha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
186 changes: 186 additions & 0 deletions doc/architecture_alpha.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/mqtt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/esp8266_weather_station/consumers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/esp8266_weather_station/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/esp8266_weather_station/producers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/esp8266_weather_station/webFrontend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/upscaling/consumers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/upscaling/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/upscaling/producers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/test/upscaling/webFrontend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/weatherStation.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions frontend/src/test/java/io/weatherStation/ExampleResourceTest.java

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions persist/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ persistence:
password: thunderstorm
queueName: measurement-records-persistence
containerId: persistence
maxBufferedMessages: 4096
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ public void start(Future<Void> startFuture) throws Exception {
startFuture.fail(connectionResult.cause());
} else {
AmqpConnection amqpConnection = connectionResult.result();
var amqpConnectionOptions = new AmqpReceiverOptions()
var amqpReceiverOptions = new AmqpReceiverOptions()
.setAutoAcknowledgement(false)
.setDurable(true);
.setDurable(true)
.setQos("AT_LEAST_ONCE")
.setMaxBufferedMessages(this.config().getInteger("maxBufferedMessages"));
amqpConnection.createReceiver(
this.config().getString("queueName"),
amqpConnectionOptions,
amqpReceiverOptions,
receiverCreationResult -> {
if (receiverCreationResult.failed()) {
startFuture.fail(receiverCreationResult.cause());
Expand All @@ -52,7 +54,7 @@ public void start(Future<Void> startFuture) throws Exception {
}

private void handleWeatherRecordMessage(AmqpMessage amqpMessage) {
JsonObject body = amqpMessage.bodyAsJsonObject();
var body = new JsonObject(amqpMessage.bodyAsString());
this.eventBus.send(
EventBusAddresses.PERSISTENCE_POSTGRESQL,
body,
Expand All @@ -64,6 +66,7 @@ private void handleWeatherRecordMessage(AmqpMessage amqpMessage) {
response.cause().printStackTrace(System.err);
} else {
amqpMessage.accepted();
System.out.println("Duplicated record not inserted for " + body);
}
} else {
amqpMessage.accepted();
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions stationSimulator/src/main/java/com/wetr/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private static List<StationSimulator> createStationSimulators(final int weatherS
List<StationSimulator> stationSimulators = new ArrayList<>();
stationSimulators.add(createStationSimulator(weatherStationIdOffset));
stationSimulators.add(createStationSimulator(weatherStationIdOffset));
stationSimulators.add(createStationSimulator(weatherStationIdOffset));
return stationSimulators;
}

Expand Down

0 comments on commit 85d6706

Please sign in to comment.