private void notify(Notification notification, Exception e, String msg) { try { if (notification != null && notification.isInternalException()) log.error("SUPPRESSED: "+msg, e); else { SendNotificationResponse response = notifier.begin().summary(msg).exception(e).send().get(); } } catch (Exception ex) { log.error("Exception sending notification", ex); } } }
int notificationsToSend = Integer.valueOf(countString.trim()); notifier.onBegin(b -> b.topic("hn-test").trackingId(TimeUuid.randomUUID().toString())); .topic("Swing Admin App") .summary("Here is a longer summary message. There really is no maximum length but it would be awkward for it to be too long: " + i) .trait("key1", "value1") .trait("index", String.valueOf(i)) .trait("no_value_key", null) .link("example", "http://example.com") .link("Tioga YouTrack", "http://tioga.myjetbrains.com/") .exception(new Throwable("This is notification exception")) .attach("attachOne", MediaType.TEXT_PLAIN, "Test main attachment one") .attach("attachTwo", MediaType.TEXT_PLAIN, "Test main attachment two"); Future<SendNotificationResponse> future = builder.send();
private void notify(Notification notification, Exception e, String msg) { try { if (notification != null && notification.isInternalException()) log.error("SUPPRESSED: "+msg, e); else notifier.begin().summary(msg).exception(e).send().get(); } catch (Exception ex) { log.error("Exception sending notification", ex); } } }
private void notify(Notification notification, Exception e, String msg) { try { if (notification != null && notification.isInternalException()) log.error("SUPPRESSED: "+msg, e); else notifier.begin().summary(msg).exception(e).send().get(); } catch (Exception ex) { log.error("Exception sending notification", ex); } } }