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)
Share
If you are referring to pubsub then you can either configure the node so that it does not persist items with
persist_itemsandmax_items.If you have no control over the node creation then what you can do is check for the delay namespace (
jabber:x:delayand/orurn:xmpp:delay) in the packetYou can also make some decision by examining the
DelayInformationobject 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.