You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Лаури <la...@mail.ru> on 2012/08/22 14:49:39 UTC

Vysper: how to make use of pubsub module in application extending vysper

Hello.

Is there documentation for vysper available? Something like cookbook?
I'm trying to make a game server based on vysper. Mostly i'm getting
recipes for the problems from code of unit test for vysper but the more
sophisticated problem is the harder the recipe to be found.

Can someout point out how to make use of pubsub extension?
Let's say i have a custom thing like game room and it is willing to publish
some event like "player amout have been changed".
What do I do?
Do I make use if LeafNode.pusblish or what? If LeafNode is the answer then
how to I obtain StanzaRelay parameter in publish method?

Cheers, Lauri.

Re: Vysper: how to make use of pubsub module in application extending vysper

Posted by Bernd Fondermann <bf...@brainlounge.de>.
Hi Lauri,

On 22.08.12 14:49, Лаури wrote:
> Hello.
>
> Is there documentation for vysper available? Something like cookbook?
> I'm trying to make a game server based on vysper. Mostly i'm getting
> recipes for the problems from code of unit test for vysper but the more
> sophisticated problem is the harder the recipe to be found.
>
> Can someout point out how to make use of pubsub extension?
> Let's say i have a custom thing like game room and it is willing to publish
> some event like "player amout have been changed".
> What do I do?
> Do I make use if LeafNode.pusblish or what? If LeafNode is the answer then
> how to I obtain StanzaRelay parameter in publish method?

Ok, I assume you have some application running a Vysper Server. Then you 
have clients "players", connecting to Vysper/PubSub. Then you want to 
publish some information for those players subscribed to a pubsub leaf. 
Great. Typically, this would be done by having one "server-side" client, 
or controller client, which is connected to Vysper/PubSub as well and is 
responsible for doing publishing such information. In this case, the 
controller client sends a regular XMPP message to Vysper/Pubsub. There 
is no need to mess around with the internals of Vysper like LeafNode. 
This is not the intended way how to interact with Vysper/Pubsub.

Two suggestions: First, please take a look at the code at 
/examples/pubsub-client in the Vysper trunk. It shows how to interact 
with PubSub from Java client based on the Java XMPP library Smack.
Secondly, please consult XEP-0060 Publish-Subscribe if you haven't done 
already.

   Bernd