}
continue;
}
// Add all the other destinations of the same message as a FORWARD_HEADER entry
FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
dos.writeInt(messages.getValue().size() - 1);
while (iter.hasNext())
{
InetAddress destination = iter.next();
CompactEndpointSerializationHelper.serialize(destination, dos);
String id = MessagingService.instance().addCallback(handler, message, destination);
dos.writeUTF(id);
if (logger.isDebugEnabled())
logger.debug("Adding FWD message to: " + destination + " with ID " + id);
}
message = message.withHeaderAdded(RowMutation.FORWARD_HEADER, bos.toByteArray());
// send the combined message + forward headers
String id = MessagingService.instance().sendRR(message, target, handler);
if (logger.isDebugEnabled())
logger.debug("Sending message to: " + target + " with ID " + id);
}