开发者

chat application on appengine

I am willing to implement a chat website on App Engine. But I found that Ap开发者_开发技巧p Engine will not allow me to go with server push. (as it will kill the response after 30 sec).

  1. So whats the other method that can be used? Will polling cause bad user experience? Meaning will the user have to wait for some time to retrieve new messages from the server?

  2. What will be the ideal polling interval?

  3. If you use very small polling intervals, will my bandwidth get exhausted? Will I suffer performance problems?


This is a quite old question now, but I was looking for a similar answer. I think the Channel API (http://code.google.com/appengine/docs/java/channel/) is much better suited for the task. For what I understand, XMPP is good to interact with the app, but not with other users. Channel API implement push notifications via HttpRequest. I just found an example of a chat room here: https://bitbucket.org/keakon/channelchat


Can't you just use XMPP instead of a website? It would be a much better approach. Polling certainly isn't going to scale very well and will definitely not give a good user experience.

XMPP with appengine


I've heard of people working around that by holding the connection (i.e. sending no response) until it dies then reestablishing it. 30 seconds is not that much though.

If done this way it would still feel more responsive to the user than polling every 30 secs.

About the bandwith usage: Depending on the payload "typical" HTTP requests can range from a few hundred bytes to some kBytes especially with cookies.

With an average size of let's say 5kB (pessimistic) every 30 sec that would sum up to around 14 MB per 24 hrs. Maybe you can cut down the size by setting a path in your cookies so they don't get send for these connections. Maybe you don't need to send the whole payload again every 30 secs.


yeah channel api is the best solution, with gwt is even better

http://www.dev-articles.com/article/Google-App-Engine-sending-messages-with-XMPP-393002

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜