@Test public void sendToNode() { BlockMessage blockMessage = new BlockMessage(); Node node = new Node("192.168.1.90",8003,1); boolean aysn = true; assertTrue(messageBusService.sendToNode(blockMessage, node, aysn).isSuccess()); }
@Override public Result sendToNode(BaseMessage message, Node node, boolean aysn) { BroadcastResult result = networkService.sendToNode(message, node, aysn); if (!result.isSuccess()) { Log.error("send to node fail reason: " + result.getErrorCode().getMsg() + "::::" + node.getId()); } return new Result(result.isSuccess(), result.getErrorCode(), null); }
MessageBusServiceImpl implements MessageBusService { @Override public Result sendToNode(BaseMessage message, Node node, boolean aysn) { BroadcastResult result = networkService.sendToNode(message, node, aysn); if (!result.isSuccess()) { Log.error("send to node fail reason: " + result.getErrorCode().getMsg() + "::::" + node.getId()); } return new Result(result.isSuccess(), result.getErrorCode(), null); } }
MessageBusServiceImpl implements MessageBusService { @Override public Result sendToNode(BaseMessage message, Node node, boolean aysn) { BroadcastResult result = networkService.sendToNode(message, node, aysn); if (!result.isSuccess()) { Log.error("send to node fail reason: " + result.getErrorCode().getMsg() + "::::" + node.getId()); } return new Result(result.isSuccess(), result.getErrorCode(), null); }  }
MessageBusServiceImpl implements MessageBusService { @Override public Result sendToNode(BaseMessage message, Node node, boolean aysn) { BroadcastResult result = networkService.sendToNode(message, node, aysn); if (!result.isSuccess()) { Log.error("send to node fail reason: " + result.getErrorCode().getMsg() + "::::" + node.getId()); } return new Result(result.isSuccess(), result.getErrorCode(), null); }  @Override String subscribeMessage(Class<? extends BaseMessage> messageClass, NulsMessageHandler<? extends BaseMessage> messageHandler); @Override void unsubscribeMessage(String subscribeId); @Override void receiveMessage(BaseMessage message, Node node); void shutdown(); @Override Result<List<String>> broadcast(BaseMessage message, Node excludeNode, boolean aysn, int percent); @Override Result sendToNode(BaseMessage message, Node node, boolean aysn); @Override Result<? extends BaseMessage> getMessageInstance(short moduleId, int type); }
MessageBusServiceImpl implements MessageBusService { @Override public Result sendToNode(BaseMessage message, Node node, boolean aysn) { BroadcastResult result = networkService.sendToNode(message, node, aysn); if (!result.isSuccess()) { Log.error("send to node fail reason: " + result.getErrorCode().getMsg() + "::::" + node.getId()); } return new Result(result.isSuccess(), result.getErrorCode(), null); }  @Override String subscribeMessage(Class<? extends BaseMessage> messageClass, NulsMessageHandler<? extends BaseMessage> messageHandler); @Override void unsubscribeMessage(String subscribeId); @Override void receiveMessage(BaseMessage message, Node node); void shutdown(); @Override Result<List<String>> broadcast(BaseMessage message, Node excludeNode, boolean aysn, int percent); @Override Result sendToNode(BaseMessage message, Node node, boolean aysn); @Override Result<? extends BaseMessage> getMessageInstance(short moduleId, int type);  }