use of org.hisp.dhis.outboundmessage.OutboundMessageBatch in project dhis2-core by dhis2.
the class DefaultProgramMessageService method sendMessages.
@Override
public BatchResponseStatus sendMessages(List<ProgramMessage> programMessages) {
List<ProgramMessage> populatedProgramMessages = programMessages.stream().map(this::setAttributesBasedOnStrategy).collect(Collectors.toList());
List<OutboundMessageBatch> batches = createBatches(populatedProgramMessages);
BatchResponseStatus status = new BatchResponseStatus(messageBatchService.sendBatches(batches));
saveProgramMessages(programMessages, status);
return status;
}
Aggregations