Search in sources :

Example 1 with OutboundMessageBatch

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;
}
Also used : BatchResponseStatus(org.hisp.dhis.outboundmessage.BatchResponseStatus) OutboundMessageBatch(org.hisp.dhis.outboundmessage.OutboundMessageBatch)

Aggregations

BatchResponseStatus (org.hisp.dhis.outboundmessage.BatchResponseStatus)1 OutboundMessageBatch (org.hisp.dhis.outboundmessage.OutboundMessageBatch)1