String encodedMessage = encodeMessage(msg);
for (String userUniqueId : userUniqueIds) {
String key = getAppKeyForUser(userUniqueId);
logger.info("Pushing msg to " + key);
try {
getChannelService().sendMessage(new ChannelMessage(key, encodedMessage));
} catch (Exception e) {
// [The original google example code notes here:
// A bug in the dev_appserver causes an exception to be
// thrown when no users are connected yet.]
logger.log(Level.SEVERE, "Failed to push the message " + msg + " to client " + key, e);