powered by Jive Software

Problem with PubSub nodes (Smack 4.2.1)

I am having some trouble with pubsub working against both openfire and ejabberd. Below is an example for openfire (code is in scala):

val manager = PubSubManager.getInstance(connection, connection.getUser.asBareJid())

val config = new ConfigureForm(DataForm.Type.submit)

config.setPersistentItems(true)

config.setDeliverPayloads(true)

config.setAccessModel(AccessModel.presence)

config.setPublishModel(PublishModel.publishers)

config.setMaxItems(1)

config.setSubscribe(true)

val node = manager.createNode(“myTestNode”, config).asInstanceOf[LeafNode]

This produces the following request/response:

11presencepublishers11

Then we publish to the node:

val payload = new SimplePayload(null, null, content)

val payloadItem = new PayloadItem(null, payload)

node.publish(payloadItem)

which produces the following request/response:

However, when trying to retrieve the node info in a later session like this:

val manager = PubSubManager.getInstance(connection, connection.getUser.asBareJid())

manager.getNodeLeafNode

We get the following request/response:

However, the node still clearly exists, because if we try to recreate it, we get an error:

Any suggestions as to where I’m going wrong would be great!

Best,

Iachimoe

Small clarification: The payload in the example I put here is , and I read somewhere that the xml tag needs a namespace, but in fact in my real code, the xml is much bigger (and uses namespaces as appropriate), I just truncated it to here for brevity.

ejabberd?

As far as I remember, the example I posted related to running smack against an openfire server, but it also doesn’t work on ejabberd. I can produce similarly detailed logs against ejabberd if that would be useful.

Having tested this with the most recent version of ejabberd (previously I was using an older version), it works OK. Which suggests that there may be a PubSub bug in openfire? Is it appropriate at this point to file a bug against openfire?