views:

89

answers:

2

I have an XMPP server (likely — python, twisted, wokkel), which I prefer not to restart even in the development version, and I have some python module “worker” (which is interface to particular django project), which gets jid and message text and returns some response (text or XML, either way).

The question is, what would be the best way to connect them, considering that I may prefer to update the module part too often? Another consideration is that it might be required to run multiple instances of “worker” for it all to be high-load-capable.

One possible way I see is implementing a thread in the server which checks if the module was changed and reload()s it if necessary. The other way would be making something similar to fastcgi through sockets, although not HTTP-based.

A: 

I can't say that I understand all of your question, but the bit where you're asking how to connect django and twisted and multiple workers: I'd suggest using AMPQ. This gets you reliable message delivery, multiple consumers, persistence.

There's the txAMQP library for twisted.
https://launchpad.net/txamqp

A good primer to AMQP here, it's a good place to start:
http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/

MattH
From what I see it looks like an overkill, considering that I have only one XMPP server and one to few non-web django-based workers that process requests in the similar style to web requests.
+1  A: 

My suggestion is:

  1. Use RabbitMQ with XMPP adaptor.
  2. Use Python carrot for AMQP since it can be used directly under Django.
sw