users@jersey.java.net

Re: [Jersey] jersey/REST for a chat

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 09 Jun 2009 11:54:51 +0200

On Jun 9, 2009, at 9:15 AM, Robert Naczinski wrote:

> Hi,
>
> I have a philosophical question to REST. Would you use jersey/REST to
> implement a chat?
>
> On Clientside would be a java applet with periodic call of my server
> with Jersey/REST.
>
> Is this realistic?
>

I do not think polling is a realistic solution for "real-time"
feedback, which is important for chat-like applications. Thus for such
cases REST is not really suitable.

However, it is possible to relax some of the REST constraints, namely
request/response constraint and have an application that supports
Comet-style interactions for some resources. Which is what the
Atmosphere project aims to do: provide a portable low-layer on top of
HTTP servers, and a high, ease of use layer, utilizing Jersey.

See http://atmosphere.dev.java.net, which contains a Jersey-based chat
example. Note that this is still work in progress but JeanFrancois is
making good progress :-)

Paul.