Archived
0

decompress eddn message, improve debug info

This commit is contained in:
Mo
2016-09-18 18:20:44 +03:00
parent d0d2b84afc
commit ea8ea96fc5
7 changed files with 17 additions and 6 deletions

View File

@@ -73,8 +73,9 @@ public class Receiver implements Runnable {
byte[] receivedData = subscriber.recv(ZMQ.PAIR); byte[] receivedData = subscriber.recv(ZMQ.PAIR);
LOG.trace("Received data: {}", receivedData); LOG.trace("Received data: {}", receivedData);
if (receivedData == null) continue; if (receivedData == null) continue;
// receivedData = decompress(receivedData); receivedData = decompress(receivedData);
String marketJson = new String(receivedData, "UTF-8"); String marketJson = new String(receivedData, "UTF-8");
LOG.trace("Decompress message: {}", marketJson);
builder.append(marketJson); builder.append(marketJson);
if (!subscriber.hasReceiveMore()){ if (!subscriber.hasReceiveMore()){
Message message = parser.parse(builder.toString()); Message message = parser.parse(builder.toString());

View File

@@ -43,4 +43,14 @@ public class Body {
public void addAll(Collection<Item> items){ public void addAll(Collection<Item> items){
commodities.addAll(items); commodities.addAll(items);
} }
@Override
public String toString() {
return "Body{" +
"system=" + system +
", station=" + station +
", timestamp=" + timestamp +
", commodities=" + commodities +
'}';
}
} }

View File

@@ -41,6 +41,6 @@ public class Header {
", softwareName='" + softwareName + '\'' + ", softwareName='" + softwareName + '\'' +
", softwareVersion='" + softwareVersion + '\'' + ", softwareVersion='" + softwareVersion + '\'' +
", gatewayTimestamp=" + gatewayTimestamp + ", gatewayTimestamp=" + gatewayTimestamp +
"} " + super.toString(); '}';
} }
} }

View File

@@ -73,6 +73,6 @@ public class Item {
", sellPrice=" + sellPrice + ", sellPrice=" + sellPrice +
", demand=" + demand + ", demand=" + demand +
", demandLevel=" + demandLevel + ", demandLevel=" + demandLevel +
"} " + super.toString(); "} ";
} }
} }

View File

@@ -34,6 +34,6 @@ public class Message {
"schemaRef='" + schemaRef + '\'' + "schemaRef='" + schemaRef + '\'' +
", header=" + header + ", header=" + header +
", body=" + body + ", body=" + body +
"} " + super.toString(); "} ";
} }
} }

View File

@@ -35,6 +35,6 @@ public class StarSystem {
"name='" + name + '\'' + "name='" + name + '\'' +
", id=" + id + ", id=" + id +
", address=" + address + ", address=" + address +
"} " + super.toString(); "} ";
} }
} }

View File

@@ -25,6 +25,6 @@ public class Station {
return "Station{" + return "Station{" +
"name='" + name + '\'' + "name='" + name + '\'' +
", id=" + id + ", id=" + id +
"} " + super.toString(); "} ";
} }
} }