读旧事件
我在使用 Smack 3.1 的应用程序和运行 openfire 的服务器时遇到问题。启动应用程序后,它将读取节点上的最后一条消息。这是行不通的,因为消息被解析、处理并放入数据库中。除了在有效负载中发送消息创建时间之外,还有什么方法可以阻止这种重复吗? (实际上,如果有任何信号表明消息已被“消耗”,那就太棒了)
I am having a problem with an application using Smack 3.1 and a server running openfire. Upon starting the application, it will read the last message on the node. This doesn't work since the messages are parsed, processed and placed into a db. Besides sending a message creation time in the payload, is there any way to stop this duplication? (Actually if there is anyway to signal that a message has been "consumed" would be fantastic)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您指的是 pubsub,那么您可以配置节点,使其不使用
persist_items
和max_items
持久化项目。如果您无法控制节点创建,那么您可以做的是检查延迟命名空间(
jabber:x:delay
和/或urn:xmpp:delay
) 如果是 PEP ,您还可以通过检查
DelayInformation
对象来做出一些决定,例如时间长短、原因等。那么您将始终获得发布的最后一项,我认为没有办法确定是否延迟即。数据包中没有延迟信息。
您需要获取每夜构建或构建您自己的以获得 pubsub 支持。我认为当前版本 Smack 3.1.0 不支持 pubsub。
If you are referring to pubsub then you can either configure the node so that it does not persist items with
persist_items
andmax_items
.If you have no control over the node creation then what you can do is check for the delay namespace (
jabber:x:delay
and/orurn:xmpp:delay
) in the packetYou can also make some decision by examining the
DelayInformation
object as to how long, reason, etc.If it is PEP then you will always get the last item published and I think there is no way of determining if it was delayed viz. there is no delay info in the packet.
You need to either get nightly builds or build your own for pubsub support. I don't think the current version Smack 3.1.0 supoorts pubsub.