feat: add field status in return value of WSClientConsumer.publishEvent

This commit is contained in:
Frank.R.Wu 2021-11-05 14:53:20 +08:00
parent 82e7003083
commit 08f86a445f
2 changed files with 3 additions and 1 deletions

View File

@ -173,7 +173,8 @@ public class EventBroker {
topic2cIds.get(topic).add(cId);
switch (consumer.getType()) {
case Contract:
LOGGER.info("contract " + ((ContractConsumer) consumer).getContract() + " subscribes topic " + topic);
LOGGER.info("contract " + ((ContractConsumer) consumer).getContract() +
" subscribes topic " + topic);
break;
case Node:
LOGGER.info("node " + consumer.getId() + " subscribes topic " + topic);

View File

@ -41,6 +41,7 @@ public class WSClientConsumer implements IEventConsumer {
}
JsonObject ret = new JsonObject();
ret.addProperty("action", "onEvent");
ret.addProperty("status", "Success");
ret.add("data", JsonUtil.parseString(msg));
channel.writeAndFlush(new TextWebSocketFrame(ret.toString()));
}