Hello folks,
I’m quite new to openfire and XMPP, and i’m trying to implement a service to notify the gps coordinates sent by mobile devices.
I worked on this approach:
When a user (say: jack@myopenfiredomanin.com ) come online it create a “node” (i.e. update_jack@myopenfiredomanin.com) and begin publishing notifications to that.
When another user want to know about the jack@myopenfiredomanin.com coordinates it subscibe the node update_jack@myopenfiredomanin.com.
I would, first of all to be clarified, all about the openfire server settings.
I set the following properties:
xmpp.pubsub.create.anyone true
xmpp.pubsub.enabled true
xmpp.pubsub.root.nodeID ireachyouservice
xmpp.pubsub.service pubsub
The first one is becouse I would like to make possible for a user from another domain/server to create node. (I’d like to offer this service to gtalk user for example). I read that there are problems about that, but i’d like to circumvent those by creating the node through a plugin.
I send this packet to create a node:
<pubsub xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)">
<create node="update_cloud@ireachyou.hopto.org">
My questions:
-
This message was replied good, but why i have to put to=“ireachyou.hopto.org” instead of pubsub.ireachyou.hopto.org ??
-
I put:
System.out.println(" -> Root: " + service.getRootCollectionNode().getNodeID() );
System.out.println(" -> Existing nodes at service: " + service.getServiceID() );
Collection nodes2 = service.getNodes();
Iterator itr2 = nodes2.iterator();
while ( itr2.hasNext() )
{
Node node2 = (Node)itr2.next();
System.out.println(" -> " + node2.getNodeID() );
}
in the createNode method in the PubSubEngine Class, and the result is:
-> Root: cloud@ireachyou.hopto.org
-> Existing nodes at service: cloud@ireachyou.hopto.org
-> update_cloud@ireachyou.hopto.org
while i expect Root is ireachyouservice.ireachyou.hopto.org, and why it appears as I have created a service and 2 node?
The final result is that each user sees (when he tries to subscribbe!) only the nodes in “his” service, and doesnt see other nodes!
I hope someone can help me.