Hi all,
I am a newbie to Smack, and am trying to write a jabber client which uses the XEP-0060 pub/sub extension. I use ejabberd 2.1.10 as xmpp server.
The jabber client works well but the performance is very bad. Retrieving an existing node is very slow.
I figured it out with adding some time measurements.
public void publish(Item item, String nodeName) throws XMPPException {
long start = System.currentTimeMillis();
LeafNode myNode = (LeafNode) pubSubManager.getNode(nodeName);
System.out.println(System.currentTimeMillis() - start);
myNode.publish(item);
}
Is there a reason why it takes up so much time? 450ms - 480ms? The sending throughput is about 2 messages per seconds.
Is there a workaround to minimize the time consumption?
The creation of a node:
public void createNode(String nodeName) throws XMPPException {
ConfigureForm form = new ConfigureForm(FormType.submit);
form.setPersistentItems(false);
form.setDeliverPayloads(false);
form.setNotifyRetract(true);
form.setPublishModel(PublishModel.open);
form.setAccessModel(AccessModel.open);
form.setSubscribe(true);
manager.createNode(nodeName, form);
}
Thanks in advance!
Kind regards,
Bill