Java – A pattern for building chat applications using XMPP

A pattern for building chat applications using XMPP… here is a solution to the problem.

A pattern for building chat applications using XMPP

I built an Android application using Google App Engine Server. Now I want to add a simple chat to my app. I have some questions.

  • My users have registered the email domains they want, such as hotmail.com, yahoo.com, or even more esoteric, does that mean I need to create a JID for them? If so, does Google App Engine provide JID creation for app domains that I can manipulate?

  • I

  • read that Google App Engine acts as an XMPP client, so I need an XMPP server that can receive and send XMPP messages. So why should I do GAE? Is Openfire my answer? Can I integrate Openfire with GAE?

  • I

  • also read that if I want to use XMPP in GAE and Android, my client needs an Smack API, and it works on HTTP. So I guess I need to poll the server every few seconds for messages. Is there a better model?

Solution

can I integrate Openfire with GAE?

You can’t run Openfire on

GAE because GAE can only run on HTTP, so you can’t connect over sockets like Openfire does.

Related Problems and Solutions