← Back to team overview

dhis2-devs team mailing list archive

Re: Adding Vumi integration to DHIS-2

 

On Wed, Oct 10, 2012 at 7:21 PM, Simon Cross
<simon.cross@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Oct 10, 2012 at 8:50 AM, Lars Helge Øverland
> <larshelge@xxxxxxxxx> wrote:
>> sorry for that.. Can't remember this message, maybe it was blocked by
>> launchpad, did you sign up for a launchpad account before sending?
>
> I did but didn't have this email address linked. Work email address
> now linked. Launchpad didn't send me a bounce message though.
>
>> The sections specific for messaging here:
>>
>> http://dhis2.org/doc/snapshot/en/user/html/ch23s10.html
>
> This looks like it's mostly for sending messages via DHIS2? Or is
> querying via something like
>
>   curl "http://apps.dhis2.org/demo/api/messageConversations"; -H
> "Accept:application/xml" -u mobile:district -X GET -v
>
> how DHIS2 sends messages out?
>
> We want to connect Vumi to DHIS2 as a transport (i.e. something that
> DHIS2 uses to send messages to cellphones).
>
> Thanks for the quick response!
>
> Schiavo
> Simon


Okay so I misunderstood a bit. How does one send messages through
vumi? Can you make http posts to some resource?

The way dhis sends message is pluggable but at the moment requires
that you dig into the source code. If you have the source available,
have a look in the dhis-service-core module (repo path is
dhis2/dhis-2/dhis-services/dhis-service-core). Class
org.hisp.dhis.message.DefaultMessageService allows for plugging in
implementations of interface MessageSender.

Currently we have two implementations:

- org.hisp.dhis.message.EmailMessageSender (in dhis-service-core module)
- org.hisp.dhis.sms.outbound.SmsMessageSender (in dhis-service-sms module)

We are using Spring as an adhoc solution for plugging, just implement
the interface, define your implementation as a bean in beans.xml
(src/main/resources) and Spring will auto-wire it and invoke the
MessageSender.sendMessage method when dhis sends a message. It will be
feasible to have a VumiMessageSender class which is doing its thing.

Given that vumi has a web api, another approach would be to have a
generic HttpMessageSender which can be configured somehow to send http
messages to URLs. Up to you. Let me know what you think.

Lars


Follow ups

References