@Override public void onMessage(ShellResponseMsg shellMsg) { String command = shellMsg.getCommand(); if (command == null) { throw new IllegalArgumentException("Command not found in bolt message: " + shellMsg); } if (command.equals("sync")) { setHeartbeat(); } else if (command.equals("ack")) { setHeartbeat(); handleAck(shellMsg.getId()); } else if (command.equals("fail")) { setHeartbeat(); handleFail(shellMsg.getId()); } else if (command.equals("error")) { handleError(shellMsg.getMsg()); } else if (command.equals("log")) { handleLog(shellMsg); } else if (command.equals("emit")) { handleEmit(shellMsg); } else if (command.equals("metrics")) { handleMetrics(shellMsg); } }