50

I've been doing some work with the JAX-RS reference implementation (Jersey). I know of at least two other frameworks (Restlet & Apache CXF).

My question is: Has anyone done some comparison between those frameworks and if so, which framework would you recommend and why?

bluelurker
  • 1,353
  • 3
  • 19
  • 27
Shimi Bandiel
  • 5,773
  • 3
  • 40
  • 49

7 Answers7

29

FWIW we're using Jersey as its packed full of features (e.g. WADL, implicit views, XML/JSON/Atom support) has a large and vibrant developer community behind it and has great spring integration.

If you use JBoss/SEAM you might find RESTeasy integrates a little better - but if you use Spring for Dependency Injection then Jersey seems the easiest, most popular, active and functional implementation.

James Strachan
  • 9,168
  • 34
  • 31
  • 1
    Beware. Jersey 2.0 is substantially worse than 1.0 in terms of community support and features that used to work in 1.0 but were removed in 2.0. – Gili Dec 06 '13 at 04:25
  • Could you elaborate what features you are missing? – Rick-777 Jun 13 '14 at 11:05
  • We have been using Jersey, its quite impressive .... My requirements are modest and simple so I feel very happy being Jerseyiet!! @Gili can you please mention the features that you are missing ... !! – varra Mar 13 '15 at 06:59
  • @varra, a year later I no longer remember the technical details but the lack of community support and slow development by Oracle is still a major problem. – Gili Mar 13 '15 at 21:31
  • @Gili I see what you did there: https://softwareengineering.stackexchange.com/questions/155467/selecting-a-jax-rs-implementation-for-a-new-project – Sebastien Jun 09 '17 at 14:45
25

Restlet has an extensive list of extensions for Spring, WADL, XML, JSON as well and many more, including an extension for JAX-RS API.

It is also the sole framework available in six consistent editions:

  • Java SE
  • Java EE
  • Google Web Toolkit
  • Google AppEngine
  • Android
  • OSGi environments

Its main benefits are:

  • fully symmetric client and server API when JAX-RS was designed for server-side processing
  • connectors for other protocols than HTTP (mapping to HTTP semantics) when JAX-RS is HTTP only
  • much broader feature scope including full URI routing control via the Restlet API (but can integrate with Servlet if needed)
  • full provision for NIO support

The JAX-RS API can be a good choice if you are restricted to JCP approved APIs (then don't use Spring or any extension of the JAX-RS projects like Jersey and RESTeasy!), but otherwise Restlet is the most mature framework (initially released in 2005) and will give you, in its 2.0 version, all the benefits of annotations combined with a powerful and extensible class-oriented framework.

For a longer list of features, please check this page.

Best regards, Jerome Louvel

Restlet ~ Founder and Lead developer ~ http://www.restlet.org

Vikdor
  • 23,934
  • 10
  • 61
  • 84
Jerome Louvel
  • 2,882
  • 18
  • 19
7

My team and I use Restlet extensively, but not its JAX-RS features. I can tell you that I've been very impressed with the Restlet developers and community; they're very active, engaged, responsive, and committed to a stable, efficient, reliable, and effective framework. I'm sorry I can't directly address your primary interest but I thought you might find my experience with Restlet valuable.

Avi Flax
  • 50,872
  • 9
  • 47
  • 64
6

Found out that Apache Wink is very easy to work with, supports JAX-RS and has many features beyond the standard.

Shimi Bandiel
  • 5,773
  • 3
  • 40
  • 49
6

It seems like there are 4 decent JAX-RS implementations, so you are probably ok with any of them. For what it's worth, I have found Jersey (1.0.2) really nice so far. My needs are quite modest, simple back-end service, take care of plumbing and so on. And that Jersey does quite nicely.

StaxMan
  • 113,358
  • 34
  • 211
  • 239
6

My colleague mentions why we are using RESTeasy for our current project in RESTful web services in Java EE with RESTeasy (JAX-RS):

Its reference implementation, Jersey, was not chosen because we had trouble integrating it well with EJB3 and Seam 2.0.

We are using the RESTeasy implementation of JAX-RS, because we had no trouble integrating it with our EJBs and Seam. It also has sufficient documentation.

There is another implementation from Apache, but I haven’t tried it because it uses an older version of JAX-RS.

Finally there is yet another framework for RESTful web services for Java called Restlet but we did not favour it because at the time of this writing, it is using a custom architecture, even though proper JAX-RS support is in the works.

Community
  • 1
  • 1
Peter Hilton
  • 17,211
  • 6
  • 50
  • 75
  • 3
    Apache CXF (http://cxf.apache.org) has JAX-RS but there is also an Apache Incubator project that is JAX-RS compliant called Apache Wink (http://incubator.apache.org/wink/) which unlike CXF is focused just on JAX-RS. – Sam Merrell Aug 12 '09 at 22:56
  • [_2017/04/25 - Apache Wink has been retired._](https://wink.apache.org/) – Gerold Broser Oct 05 '20 at 21:38
0

I would use no framework. Just the one that comes with your applications server. If you use specifics of one framwork you'll lose portability and you'll be in the hell of what if the vendor of the app server includes a different version of your favourite framework. I'll stick to jax-ws.