java 上的邮件守护进程
我需要在 java 或 node.js 上创建类似邮件守护进程的东西。我们有一个用 PHP 编写的高负载项目,它会生成大量电子邮件注册/更新/等。目前,所有消息在处理(语言/模板)后都被放入 mongodb 中。我正在考虑编写一个小守护进程,它将每秒检查 mongo 中的新消息并将其发送出去。
我对 Java 或 Node.js 有点陌生,不想再创建一辆自行车。有人可以指出我正确的库或类似的东西吗?
PS:它应该是快速、异步和独立的。
I need to create something like mail daemon on java or node.js We have a highload project written on PHP which generates a lot of e-mail registrations/updates/etc. Currently all messages are being put into mongodb after processing (language/template). I'm considering writing a small daemon which will check for new messages in mongo every second and send them out.
I'm a little new to Java or node.js and don't want to create another bicycle. Can someone point me to the right lib or something like that?
PS: It should be fast, async and standalone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议在本地设置一个 SMTP 服务器,然后让 PHP 项目在生成邮件时将其直接发送到该 SMTP 服务器。这正是此类服务器所针对的优化场景。
您可以安装本机版本或 Apache James(用 Java 编写)。我可以推荐 postfix,它是 Ubuntu 的标准配置并且易于设置。我没有使用 Apache James 的个人经验,但它似乎是针对中低站点的完整服务器解决方案。
I would recommend setting up a SMTP-server locally, and just have the PHP project send the mails directly to that SMTP-server as they are generated. This is the exact scenario that such servers are optimized for.
Either you can install a native one or Apache James (which is written in Java). I can recommend postfix which is standard with Ubuntu and easy to setup. I do not have personal experience with Apache James, but it appears to be a complete server solution for low to medium sites.