Java/Grails 环境中用户通知的最佳解决方案架构?
我正在使用 Grails 构建一个社区网站,我想实现用户通知,就像 stackoverflow.com 一样。例如,用户每次返回网站时都会通过电子邮件或邮箱收到新事件通知(“您有新评论”、“您最喜欢的评论之一已更改”...)。
我想这是一个常见问题,我想听听您对在 Grails 领域中实现后端有哪些简单解决方案建议。例如,Java 消息服务是推荐的解决方案吗?
谢谢。
I am building a community website using Grails and I want to implement user notifications exactly like stackoverflow.com. For instance, user will get notified for new events ('You have new comments', 'one of your favorite has changed'...) either by email or in his mailbox anytime he returns to the website.
I suppose that this is a common problem and I'd like to hear what easy solution do you advice for implementing the back-end in Grails realm. For instance, is Java Message Service a recommended solution for this?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
恕我直言,没有。 Java 消息服务基本上是执行异步或排队操作。
您只需要一个用户消息系统和通知。我不知道有任何插件可以开箱即用。
我建议您使用 markAsRead 标志来实现绑定到您的用户模型的自己的消息域 POGO。
如果您想将其与电子邮件集成,您可以使用 JMS 来解耦用户导航和电子邮件/发送。如果您有高流量的网站/网络应用程序,这尤其有用
IMHO no. Java Message Service is basically to perform asynchronous or queued operations.
You just need a user messaging system and notification. I'm not aware of any plugin that could do it out of the box.
I suggest you to implement your own Message domain POGO bound to your user model with a markAsRead flag.
If you want to integrate this with email you can use JMS to decouple user navigation and email/sending. This is particularly useful if you have an high traffic website/webapp
看起来有一个插件也使用 Grails 邮件插件:
http://grails.org/plugin/notifications
http://grails.org/plugin/mail
Looks like there's a plugin for that which also uses the Grails mail plugin:
http://grails.org/plugin/notifications
http://grails.org/plugin/mail
我已经使用了 http://grails.org/plugin/mail 和 后台线程插件。这不是一个“完美”的解决方案,但它利用了 grails 生态系统并完成了工作。
I have used the http://grails.org/plugin/mail and the background-thread plugin. Not a "perfect" solution, but it leverages the grails eco-system and gets the job done.