public static void sendErrorResponseToMalformedRequest(Channel channel, long txnId, String msg) {
if (logger.isDebugEnabled()) {
logger.debug("Malformed request from " + channel.getRemoteAddress() + " msg, = " + msg);
}
MalformedRequestException mre = new MalformedRequestException(msg);
PubSubResponse response = PubSubResponseUtils.getResponseForException(mre, txnId);
channel.write(response);
}