users@jersey.java.net

Re: [Jersey] Bidirectional communication

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 23 Sep 2009 14:46:11 +0200

On Sep 21, 2009, at 8:47 PM, Tatu Saloranta wrote:

> On Mon, Sep 21, 2009 at 11:29 AM, Gili <cowwoc_at_bbs.darktech.org>
> wrote:
>>
>> Hi,
>>
>> Has there been any discussion of implementing bidirectional RESTful
>> communication (aka callbacks or P2P nodes) as mentioned here?
>> http://joshua.schachter.org/2008/07/beyond-rest.html

See also:

http://roy.gbiv.com/untangled/2008/paper-tigers-and-hidden-dragons

as it may not always be required with a bit of lateral thinking and of
course it depends on your use case.


I am wondering if it is one of the cases where a new HTTP method is
justified e.g. a method to register interest in change of a resource.
The client sends a URI to a resource where change information should
be posted.

Microsoft's RESTful Robotics has a really nice design for events. It
defines such a RESTful system using SOAP over UDP. It is a great
example of the application of the REST style to non HTTP, but i think
many things can be learnt from it.

Another solution is to utilize Comet, which is more firewall friendly,
but can break the request/response REST constraint.


>>
>> Ideally we want an ultra-light HTTP server on each node. What do you
>> recommend? Jetty? Is there anything lighter?
>
> Unless your nodes are specifically resource constrained, I think all
> current servlet containers (like Jetty, Tomcat) are quite
> light-weight. Their reputation is worse than reality. Both Jetty 6 and
> Tomcat 6 are quite nice, but full featured (i.e. know how to use http
> 1.1 persistent connections and alike), so I would start with one of
> them.
> Jetty has traditionally been slightly easier to embed so that's a good
> choice. But Tomcat 6 has come a long way and is embeddable too.
>

The low-level Grizzly integration with Jersey is IMHO a very light
weight solution.

Paul.