Skip to content

Commit b71e7a9

Browse files
committed
chore(application): Various fixes in CSV data exporter
1 parent cdfa37b commit b71e7a9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

application/conf/config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"request-time-sync",
3737
"a-gps-transmitter#request",
3838
"tc-console-request",
39-
"reset-tc-counter"
39+
"reset-tc-counter",
40+
"csv-data-exporter#request"
4041
],
4142
"outboundPermitted": [
4243
"a-gps-transmitter#notify",

application/src/main/java/de/wuespace/telestion/project/daedalus2/mongodb/CSVDataExporter.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ public void onStop(Promise<Void> stopPromise) throws Exception {
7979
private MongoClient client;
8080

8181
private void handle(CSVDataRequest request, Message<Object> message) {
82+
logger.debug("Get CSV iridium messages for target: {}", request.target());
8283
getAllIridiumMessages(request.target())
8384
.map(this::createCSVData)
84-
.onSuccess(message::reply)
85+
.onSuccess(data -> message.reply(data.json()))
8586
.onFailure(cause -> message.fail(500, cause.getMessage()));
8687
}
8788

@@ -92,7 +93,7 @@ private CSVData createCSVData(List<JsonObject> results) {
9293
.map(this::mergeInfos)
9394
.collect(Collectors.joining("\n"));
9495

95-
return new CSVData(0, header + body);
96+
return new CSVData(results.size(), header + body);
9697
}
9798

9899
private Future<List<JsonObject>> getAllIridiumMessages(String target) {

0 commit comments

Comments
 (0)