@Test public void should_continue_on_exception() { Notifier notifier1 = ev -> Mono.error(new IllegalStateException("Test")); TestNotifier notifier2 = new TestNotifier(); CompositeNotifier compositeNotifier = new CompositeNotifier(Arrays.asList(notifier1, notifier2)); StepVerifier.create(compositeNotifier.notify(APP_DOWN)).verifyComplete(); assertThat(notifier2.getEvents()).containsOnly(APP_DOWN); }
@Override public Mono<Void> notify(InstanceEvent event) { return Flux.fromIterable(delegates).flatMap(d -> d.notify(event).onErrorResume(error -> { log.warn("Unexpected exception while triggering notifications. Notification might not be sent.", error); return Mono.empty(); })).then(); }
CompositeNotifier implements Notifier { @Override public Mono<Void> notify(InstanceEvent event) { return Flux.fromIterable(delegates).flatMap(d -> d.notify(event).onErrorResume(error -> { log.warn("Unexpected exception while triggering notifications. Notification might not be sent.", error); return Mono.empty(); })).then(); } }
CompositeNotifier implements Notifier { @Override public Mono<Void> notify(InstanceEvent event) { return Flux.fromIterable(delegates).flatMap(d -> d.notify(event).onErrorResume(error -> { log.warn("Unexpected exception while triggering notifications. Notification might not be sent.", error); return Mono.empty(); })).then(); } CompositeNotifier(Iterable<Notifier> delegates); }
CompositeNotifier implements Notifier { @Override public Mono<Void> notify(InstanceEvent event) { return Flux.fromIterable(delegates).flatMap(d -> d.notify(event).onErrorResume(error -> { log.warn("Unexpected exception while triggering notifications. Notification might not be sent.", error); return Mono.empty(); })).then(); } CompositeNotifier(Iterable<Notifier> delegates); @Override Mono<Void> notify(InstanceEvent event); }
CompositeNotifier implements Notifier { @Override public Mono<Void> notify(InstanceEvent event) { return Flux.fromIterable(delegates).flatMap(d -> d.notify(event).onErrorResume(error -> { log.warn("Unexpected exception while triggering notifications. Notification might not be sent.", error); return Mono.empty(); })).then(); } CompositeNotifier(Iterable<Notifier> delegates); @Override Mono<Void> notify(InstanceEvent event);  }