HoverHell
HoverHell

Reputation: 4889

Best method of connection between automated python XMPP server and interface to django?

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.

Upvotes: 0

Views: 433

Answers (2)

sw.
sw.

Reputation: 3231

My suggestion is:

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

Upvotes: 1

MattH
MattH

Reputation: 38247

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/

Upvotes: 0

Related Questions