try {
final String endpointToken = request.params().get("endpoint");
final String payload = buffer.toString();
logger.info("Notification endpointToken [" + endpointToken + "] " + payload);
final Notification notification = simplePushServer.handleNotification(endpointToken, payload);
final NotificationMessage notificationMessage = new NotificationMessageImpl(notification.ack());
vertx.eventBus().send(writeHandlerMap.get(notification.uaid()), new Buffer(toJson(notificationMessage)));
request.response().setStatusCode(200);
request.response().end();
} catch (final Exception e) {
logger.error(e);