praekelt/vumi — pull request #665 by smn (2013-12-05 12:08:06+00:00)
Title: Allow for the GoConversationTransport to accept messages via HTTP POST

The current approach of streaming the messages on the Vumi Go side is causing problems when trying to add more workers primarily because we then have to juggle a lot more state, little things like knowing which clients are connected to which workers and make sure we route messages there.

This is a complex problem, to simplify it we're for now going to move away from streaming and focus on HTTP POST-ing messages to URLs. In Vumi Go it is already supported but not in the `GoConversationTransport`, it defaults to acting as a streaming client only.

Current implementation thoughts:

- [ ] Split out current `GoConversationTransport` into a base class that provides `get_url()` `map_message_id()` and `get_message_id()` `handle_inbound_message()` and `handle_inbound_event()`
- [ ] Create `StreamingGoConversationTransport()` that subclasses `GoConversationTransport` and let that continue the current behaviour.
- [ ] Creating `PushGoConversationTransport()` that subclasses `GoConversationTransport` and which creates two web resources that will accept `TransportUserMessage`s and `TransportEvent`s via HTTP POST. When POSTed to these should call `handle_inbound_message()` and `handle_inbound_event()` respectively with the validated payload.