LOG.debug("Sending {} to unreachable peer {}", message, peerConnection.remotePeer());
final Message envelope = createMessage(peerConnection.remotePeer(), RPC.Commands.RELAY.getNr(), Type.REQUEST_2);
try {
message.restoreContentReferences();
// add the message into the payload
envelope.buffer(RelayUtils.encodeMessage(message, connectionBean().channelServer().channelServerConfiguration().signatureFactory()));
} catch (Exception e) {
LOG.error("Cannot encode the message", e);
return new FutureDone<Message>().failed(e);
}