public void onMsgError(Msg msg, EventReason reason) { LOG.info("[ERROR] onMsgErrorCallback. reason=" + reason); if (reason == EventReason.MSG_FLUSHED) { LOG.info("[STATUS] getIsClosing() = " + this.client.client.getIsClosing()); } msg.returnToParentPool(); this.client.exitStatus = 1; // Failure on any kind of error System.exit(exitStatus); }
public void onResponse(Msg msg) { ++numberofRsps; if (numberofRsps % PRINT_COUNTER == 0) { // Read reply message String byte ch; StringBuffer buffer = new StringBuffer(); while (msg.getIn().hasRemaining() && ((ch = msg.getIn().get()) > -1)) { buffer.append((char) ch); } LOG.info("Got message response " + numberofRsps + ": '" + buffer.toString() + "'"); } msg.returnToParentPool(); exitStatus = 0; // Success, we got our message response back }