Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Google app engine (Gae) does support XMPP just as <strong>CLIENT</strong>.</p> <p>With XMPP <a href="http://code.google.com/intl/it/appengine/docs/java/xmpp/overview.html" rel="noreferrer">Gae JAVA client</a> feature you can:</p> <p><strong>SEND MESSAGE</strong></p> <pre><code>JID jid = new JID("youraccount@jabber.org"); Message msg = new MessageBuilder() .withRecipientJids(jid) .withBody("Hello i'm a fancy GAE app, how are you?") .build(); XMPPService xmpp = XMPPServiceFactory.getXMPPService(); if (xmpp.getPresence(jid).isAvailable()) { SendResponse status = xmpp.sendMessage(msg); } </code></pre> <p><strong>RECEIVE MESSAGE</strong></p> <pre><code>public class XMPPReceiverServlet extends HttpServlet { public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException { XMPPService xmpp = XMPPServiceFactory.getXMPPService(); Message message = xmpp.parseMessage(req); JID fromJid = message.getFromJid(); String body = message.getBody(); //Save to Big Table } } </code></pre> <p>Remember that JIDs can just be <em>yourappid@appspot.com</em> OR <em>foo@yourappid.appspotchat.com</em> because Google domains are not supported yet.</p> <p>For example, you could craft a toy Gae application with a simple page with:</p> <ol> <li>An html form to send text </li> <li>An html table that display the list of messages received and stored to big table.</li> </ol> <p>To test your application:</p> <ol> <li>Create an account on jabber.org</li> <li>Download Smack</li> <li>Try to send a message from Smack to yourappid@appspot.com</li> <li>Try to send a message from Gae App to youraccount@jabber.org</li> </ol> <p>In case you have your personal XMPP server (openfire) up and running, simply skip step 1 and use your domain account to receive message from your fancy Gae App.</p> <p>Have a look to XMPP <a href="http://en.wikipedia.org/wiki/Xmpp#Message_delivery_scenario" rel="noreferrer">message delivery</a> to understand how this works.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload