XMPP 聊天和通知一起吗?
我想将我的 Web 应用程序与聊天和通知服务集成,我认为最重要和最好的是 XMPP。在经历了细节之后,虽然我理解了大部分内容,但我被困在这里,即我将如何一起运行聊天和通知服务。
一种选择是运行 Strope 的不同连接,使用不同的帐户进行长轮询,其中一个用于聊天,另一个用于通知。
另一种方法是在同一个帐户上同时拥有通知和聊天,但现在的问题是,如果用户从聊天中退出,他将无法收到通知。
第一个选项对我来说似乎不可行,但是后一个选项有办法吗?
I want to integrate my web application with chat and notification service and the foremost and the best, i understand is XMPP. After going through the nitty gritties, though i understood most of it but I got stuck here i.e. how will i run a Chat and notification service together.
One option is to have run different connections of Strophe, long polling with different accounts one for chat and other for notifications.
Other one is to have both notifications and chat on the same accounts but now the problem if the user signs out from chat he wont be able to receive notifications.
The first option does not seem feasible to me, but is there a way the later one could work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用一个连接即可连接到您的“聊天”服务。将通知服务作为聊天服务器上的组件运行,或者运行单独的服务器并将它们联合在一起。客户端将能够通过您选择的 Jabber ID (JID) 中的命名方案联系通知服务(反之亦然)。确保为聊天端的用户帐户选择与通知服务不同的域名。
Use one connection, to your "chat" service. Run your notification service as a component on your chat server, or run a separate server and federate them together. The client will be able to contact the notification service (and vice-versa) via the naming scheme in the Jabber ID's (JIDs) that you pick. Make sure you pick a different domain name for the user accounts on the chat side than for the notification service.