简体   繁体   中英

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.

My suggestion is:

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

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM