Search in sources :

Example 1 with DefaultOutboundMessageBatchService

use of org.hisp.dhis.outboundmessage.DefaultOutboundMessageBatchService in project dhis2-core by dhis2.

the class ServiceConfig method defaultOutboundMessageBatchService.

@Bean("org.hisp.dhis.outboundmessage.OutboundMessageService")
public DefaultOutboundMessageBatchService defaultOutboundMessageBatchService(SmsMessageSender smsMessageSender, EmailMessageSender emailMessageSender) {
    Map<DeliveryChannel, MessageSender> channels = new HashMap<>();
    channels.put(DeliveryChannel.SMS, smsMessageSender);
    channels.put(DeliveryChannel.EMAIL, emailMessageSender);
    DefaultOutboundMessageBatchService service = new DefaultOutboundMessageBatchService();
    service.setMessageSenders(channels);
    return service;
}
Also used : DefaultOutboundMessageBatchService(org.hisp.dhis.outboundmessage.DefaultOutboundMessageBatchService) DeliveryChannel(org.hisp.dhis.common.DeliveryChannel) HashMap(java.util.HashMap) MessageSender(org.hisp.dhis.message.MessageSender) SmsMessageSender(org.hisp.dhis.sms.config.SmsMessageSender) EmailMessageSender(org.hisp.dhis.message.EmailMessageSender) Bean(org.springframework.context.annotation.Bean)

Aggregations

HashMap (java.util.HashMap)1 DeliveryChannel (org.hisp.dhis.common.DeliveryChannel)1 EmailMessageSender (org.hisp.dhis.message.EmailMessageSender)1 MessageSender (org.hisp.dhis.message.MessageSender)1 DefaultOutboundMessageBatchService (org.hisp.dhis.outboundmessage.DefaultOutboundMessageBatchService)1 SmsMessageSender (org.hisp.dhis.sms.config.SmsMessageSender)1 Bean (org.springframework.context.annotation.Bean)1