for (ChannelConnection channel : activeChannels) {
String clientId = channel.getClientId();
// Payloads are not logged
log.info("Sending message to " + clientId + " of type " + type);
ChannelMessage msg = createMessage(clientId, type, payload);
channelService.sendMessage(msg);
}
}
private static ChannelMessage createMessage(String id, MessageType type, String payload) {
String typeOrdinal = type.ordinal() + ""; // Encode enum