关于Python / Django和消息队列的建议 [英] Advice on Python/Django and message queues

查看:1187
本文介绍了关于Python / Django和消息队列的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Django中有一个应用程序,需要在各种用例中向用户发送大量的电子邮件。有人明白的原因,我不想在应用程序中同步处理这个问题。

I have an application in Django, that needs to send a large number of emails to users in various use cases. I don't want to handle this synchronously within the application for obvious reasons.

有没有人推荐过与Python完美集成的消息队列服务器,或者他们已经使用在Django项目上?我的堆栈的其余部分是Apache,mod_python,MySQL。

Has anyone any recommendations for a message queuing server which integrates well with Python, or they have used on a Django project? The rest of my stack is Apache, mod_python, MySQL.

推荐答案

到目前为止,我没有发现没有好的解决方案。我有一些更严格的软实时要求(从一个纸板箱的照片被标记),所以可能一个方法对你来说足够快。我认为电子邮件可以等待几分钟。

So far I have found no "nice" solution for this. I have some more strict soft realtime requirements (taking a picture from a cardboard box being labeled) so probably one of the approaches is fast enough for you. I assume emails can wait for a few minutes.


  • 由cron作业处理的数据库中的待办事项列表。

  • 由守护进程轮询查询的数据库中的待办事项列表。

  • 使用通过UDP数据包通过Web服务器通知的自定义守护程序(in今天生产)。基本上我自己的Queing系统与IP堆栈来处理队列。

  • 使用ActiveMQ作为消息代理 - 由于稳定性问题,这并没有解决。另外对我来说,Java守护进程通常有些丰满。

  • 在CouchDB中使用更新触发器。尼斯但更新触发器并不意味着做重度的图像处理,所以不适合我的问题。

  • A "todo list" in the database processed by a cron job.
  • A "todo list" in the database processed permanently beeing polled by a daemon.
  • Using a custom daemon which gets notified by the webserver via an UDP packet (in Production today). Basically my own Queing system with the IP stack for handling the queue.
  • Using ActiveMQ as a message broker - this didn't work out because of stability issues. Also to me Java Daemons are generally somewhat plump
  • Using Update Triggers in CouchDB. Nice but Update Triggers are not meant to do heavy image processing, so no good fit for my problem.

到目前为止我还没有尝试RabbitMQ和XMPP / ejabebrd处理问题,但他们在我的下一个要尝试的列表。 RabbitMQ在2008年期间获得了不错的Python连接,并且有大量的XMPP库。

So far I haven't tried RabbitMQ and XMPP/ejabebrd for handling the problem but they are on my list of next things to try. RabbitMQ got decent Python connectivity during 2008 and there are tons of XMPP libraries.

但是您可能需要的是在本地计算机上正确配置的邮件服务器。这可能会让您将邮件同步转储到本地邮件服务器中,从而使您的整个软件堆栈更加简单。

But perhaps all you need is a correctly configured mailserver on the local machine. This probably would allow you to dump mails synchronously into the local mailserver and thus make your whole software stack much more simple.

这篇关于关于Python / Django和消息队列的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆