praekeltfoundation / vumi

Messaging engine for the delivery of SMS, Star Menu and chat messages to diverse audiences in emerging markets and beyond.
BSD 3-Clause "New" or "Revised" License
421 stars 131 forks source link

Refactor Worker to remove special status of AMQP connection #999

Open jerith opened 9 years ago

jerith commented 9 years ago

In order to provide a uniform mechanism for managing connection failures, it would be handy to have a connection manager abstraction that monitors the state of all connections (AMQP included) and can pause/unpause them as required. (We already do this sort of thing manually in the SMPP transport, but it's pretty transport-specific.)

The major benefit would be cleaner separation between the worker and AMQP connection (which we've been heading toward with previous refactorings) and easier management of any kind of persistent connection that a worker might need.

Additionally, standard mechanisms for tracking connection state would be useful for monitoring and health checks as well as making error handling easier.

smn commented 9 years ago

@hodgestar reading this it seems like this would bring us a bit closer to allowing workers to abstract how they receive messages (AMQP or other sources) which may be useful for the ideas we have around Junebug?

jerith commented 9 years ago

it seems like this would bring us a bit closer to allowing workers to abstract how they receive messages (AMQP or other sources)

While that's technically true, there are still plenty of AMQP-centric assumptions that will be rather harder to break than merely swapping out a queueing mechanism. (Not impossible, but the reasons would have to be pretty compelling to justify the effort.)