node.getSubscriptions() does not return all users who are subscribed to the pubsub node

There seems to be a problem getting the list of subscribers of a pubsub node. getSubscriptions only returns the list of subscriptions for the current user, where as the spec says it should return all users that are subscribed to the node.

As per XEP-0060 “XEP-0060: Publish-Subscribe” the request namespace should be “” where as the request sent by smack is “


<pubsub xmlns='[]('>


<pubsub xmlns='[]('>

I noticed this in 4.0.6 and also 4.1.0-alpha6.

I think this method covers the following use case:

XEP-0060: Publish-Subscribe


Oh ok. Any idea how I can get all subscribers to a node?

AFAIK there is currently no API for that. I’ve created SMACK-623 to track that and will upload a new version of 4.1.0-alpha7-SNAPSHOT soon.

Just to clarify, does this mean 4.1.0-alpha7-SNAPSHOT will have a new API to get a list of all subscribers of a node?

Uploaded a new snapshot with: 41

Please test and report back if it works for you.

I am trying to use the new latest snapshot, but looks like XMPPTCPConnectionConfiguration.XMPPTCPConnectionConfigurationBuilder is not defined.

Its available in alpha6.

Please disregard my last. Found XMPPTCPConnectionConfiguration.Builder in the code.

I get the following exception.

Exception in thread “main” java.lang.NullPointerException

at org.jivesoftware.smackx.pubsub.Node.getSubscriptions(

at org.jivesoftware.smackx.pubsub.Node.getSubscriptionsAsOwner(

at org.jivesoftware.smackx.pubsub.Node.getSubscriptionsAsOwner(

at Client41.main(

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:43)

at java.lang.reflect.Method.invoke(

at com.intellij.rt.execution.application.AppMain.main(

In the debug window I can see all the subscriptions in the raw received packets.

It appears the subscriptions sub element is not returned. Could you show me the request and reply stanzas?


<pubsub xmlns='[]('>


<pubsub xmlns='[]('>

On line number 228 in

SubscriptionsExtension subElem = (SubscriptionsExtension) reply.getExtension(PubSubElementType.SUBSCRIPTIONS);


PubSubElementType.SUBSCRIPTIONS(“subscriptions”, PubSubNamespace.BASIC),

But for getSubscriptionsAsOwner it should have been

SUBSCRIPTIONS(“subscriptions”, PubSubNamespace.OWNER),

I guess thats why subElem is null.

Should be fixed with ab

The provider entry was missing. New snapshot uploaded.

1 Like

It works. Thanks a lot Flow

But for getSubscriptionsAsOwner it should have been

SUBSCRIPTIONS(“subscriptions”, PubSubNamespace.OWNER),

I guess thats why subElem is null.

Nope, that’s actually a little flaw in the PubSub implementations design. NodeExtension, the superclass of SubscriptionsExtensions, uses a namespace when it actually has only an implicit one inherited from the pubsub element.

You are welcome. And thanks for reporting.