- public void notifyProducerJobStarted(EiProducer producer, EiJob eiJob) {
- AsyncRestClient restClient = restClient(false);
+ /**
+ * Calls all producers for an EiJob activation.
+ *
+ * @param eiJob an EI job
+ * @return the number of producers that returned OK
+ */
+ public Mono<Integer> notifyProducersJobStarted(EiJob eiJob) {
+ return Flux.fromIterable(eiJob.type().getProducers()) //
+ .flatMap(eiProducer -> notifyProducerJobStarted(eiProducer, eiJob)) //
+ .collectList() //
+ .flatMap(okResponses -> Mono.just(Integer.valueOf(okResponses.size()))); //
+ }
+
+ /**
+ * Calls one producer for an EiJob activation.
+ *
+ * @param producer a producer
+ * @param eiJob an EI job
+ * @return the body of the response from the REST call
+ */
+ public Mono<String> notifyProducerJobStarted(EiProducer producer, EiJob eiJob) {
+ AsyncRestClient restClient = restClient();