private void deliverMessage(SockJSSocket sock, String address, Message message) {
JsonObject envelope = new JsonObject().putString("address", address).putValue("body", message.body());
if (message.replyAddress() != null) {
envelope.putString("replyAddress", message.replyAddress());
}
sock.write(new Buffer(envelope.encode()));
}
private void doSendOrPub(final boolean send, final SockJSSocket sock, final String address,
final JsonObject message) {
final Object body = getMandatoryValue(message, "body");