0

We are developing a XMPP-based notification system, we have a server and several android devices and our OpenFire server acts as a communication gateway.

On the server side, there is a OSGi bundle, which is responsible to receive all the messages from the devices and map the corresponding action.

I want to avoid anonymous login, to have some control of who is sending messages to the server, but on the other hand I want the client to auto-signup when using our android-client.

So well, my first idea was either to listen to the AccountManager and check any newly createad account and, if proceeds, add it to the server roster.
The second option is handling all the subscription requests, check whatever, and add it to the server roster in case. Obiously for the second option the client needs to request the subscription to the server, but it's easy to achieve.

I found a possible workaround for the second option here, but what option you guys think is the best?

Any other recommendation/suggestion besides these two is also welcome.

Community
  • 1
  • 1
mdelolmo
  • 6,417
  • 3
  • 40
  • 58

1 Answers1

1

It looks like pubsub (XEP-0060) would be a better fit, since it doesn't require your roster management at all. The android devices become publishers and your bundle will be a subscriber.

Based on limited information, it looks like you could simply have all users become publishers to the same single node, and then publish messages that the server side bundle will subscribe to and handle accordingly.

Some docs for Smack on pubsub.

Robin
  • 24,062
  • 5
  • 49
  • 58
  • Thanks for your reply, I will research about pubsub and study that option. Anyway I'd like to extend the "limited information". Suggestions are welcome. – mdelolmo Oct 24 '11 at 16:31
  • Hi @Robin, excuse my ignorance on this topic, but can your solution make the server publisher as well? In my scenario, the server receives and send messages asynchronously to the devices. – mdelolmo Oct 25 '11 at 16:41