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