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);
LOG.trace("Received data: {}", receivedData);
if (receivedData == null) continue;
// receivedData = decompress(receivedData);
receivedData = decompress(receivedData);
String marketJson = new String(receivedData, "UTF-8");
LOG.trace("Decompress message: {}", marketJson);
builder.append(marketJson);
if (!subscriber.hasReceiveMore()){
Message message = parser.parse(builder.toString());

View File

@@ -43,4 +43,14 @@ public class Body {
public void addAll(Collection<Item> 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 + '\'' +
", softwareVersion='" + softwareVersion + '\'' +
", gatewayTimestamp=" + gatewayTimestamp +
"} " + super.toString();
'}';
}
}

View File

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

View File

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

View File

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

View File

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