powered by Jive Software

XEP-313 xmlns

I am new to XMPP, using Smack on Android. I started to look into XEP-313 to pull message archives from Open Fire (v4.0.2) to Android client. Was very pleased to see the recent efforts to add this to Smack 4.2 beta, so I switched from v4.1.7 to v4.2 beta (smack-nightly-SNAPSHOT-4.3-2016-08-04), however I am unable to pull message archives from Open Fire (with Monitoring plugin 1.5.4). As you’ll see in verbose details below I was able to get it partially working with code change. My question boils down to which namespace is correct: Smack and XEP-313 (mam:1), or Open Fire (mam:0)?

Using Smack DEBUG flag, I found that Smack’s new MAM Manager code is using xmlns='urn:xmpp:mam:1 e.g.

SENT (0): urn:xmpp:mam:12016-08-07T03:18:00.222+00:00</i q>

but Open Fire seems to be reporting supported feature of e.g.

RECV (0):

As a result the Smack MamManager.isSupportedByServer() is returning false, and an attempt to queryArchive() fails with an error 503 from Open Fire e.g.

urn:xmpp:mam:12016-08-07T03:18:00.222+00:00

For a quick test, I modified my local smack-experimental-4.2.0-beta3-SNAPSHOT.jar to use xmlns=‘urn:xmpp:mam:0’ e.g.

urn:xmpp:mam:02016-08-07T02:33:01.041+00:00</i q>

With this change, I was able to get delayed/forwarded messages sent back from Open Fire to my Smack client, followed by the FIN message. However, minor side issue, during processing of these messages I get these errors as well…

E/xceptionLoggingCallback﹕ Smack message parsing exception. Content: ‘8c1ba7cf-e539-4fcb-b364-c6d346a877d9’

  • java.lang.IllegalArgumentException: Namespace must not be null or empty*

  •        at org.jivesoftware.smack.util.StringUtils.requireNotNullOrEmpty(StringUtils.java: 426)*
    
  •        at org.jivesoftware.smack.packet.StandardExtensionElement.<init>(StandardExtension Element.java:69)*
    
  •        at org.jivesoftware.smack.packet.StandardExtensionElement.<init>(StandardExtension Element.java:43)*
    
  •        at org.jivesoftware.smack.packet.StandardExtensionElement$Builder.build(StandardEx tensionElement.java:218)*
    
  •        at org.jivesoftware.smack.parsing.StandardExtensionElementProvider.parse(StandardE xtensionElementProvider.java:96)*
    

AND

  • java.lang.ClassCastException: org.jivesoftware.smack.packet.EmptyResultIQ cannot be cast to org.jivesoftware.smackx.mam.element.MamFinIQ*

  •        at org.jivesoftware.smackx.mam.MamManager.queryArchive(MamManager.java:396)*
    
  •        at org.jivesoftware.smackx.mam.MamManager.queryArchive(MamManager.java:232)*
    
  •        at org.jivesoftware.smackx.mam.MamManager.queryArchiveWithStartDate(MamManage.java :178)*

Both Namespaces are correct. They just denote different versions of MAM. Have a look at XEP-0313: Message Archive Management

Thanks for the link. Do you have a recommendation for using Smack MAM support in conjunction with Open Fire? It seems my quick test to revert Smack to use mam:0 is probably not the best answer.

The most desirable approach would be to update Openfire with the new namespace (of course not just the namespace, but also the changes, which come along with it).

“Downgrading” Smack to an old spec (which I can’t even find quickly) is less fruitful in my opinion.

CSH wrote:

The most desirable approach would be to update Openfire with the new namespace (of course not just the namespace, but also the changes, which come along with it).

“Downgrading” Smack to an old spec (which I can’t even find quickly) is less fruitful in my opinion.

You can find old versions of XEPs in the attic of the XMPP Standards Foundation: Index of /extensions/attic/

In this case XEP-0313 v3 is what you want to look at XEP-0313: Message Archive Management

But yes, upgrading Openfire is what should be done.

I created a new discussion over on the OpenFire support list

XEP-313 xmlns

Seems no activity on the Open Fire support thread yet. I may not have posted to proper group or something.

Are you aware of any XMPP servers which currently support mam:1 ? Maybe you could share what you all used to test this support within Smack?

Prosody, Tigase, ejabberd and mongooseIM should support mam:1.

We run in the same problem, running against Openfire 4.0.2 and 4.0.3 (and Mlink)

For this purpose i made an MAM implementation for mam:0 but I never proposed this for the Smack lib, because of the inconsistency with the standard.

You can find this at GitHub - annovanvliet/Smack at XEP-313-MAM

See also XEP-0313: Message Archive Management (MAM) for some more explanation