Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java REST implementation: Jersey vs CXF [closed]

What do you think is the advantages/disadvantages between this two libraries? Which of these two are best suited for production environment? By the way I will be using JSON instead of XML.

I also would like to know what library is most supported by the community e.g. tutorials, documentation.

like image 871
dexter Avatar asked Apr 24 '10 13:04

dexter


People also ask

What is difference between RESTEasy and Jersey?

Both Jersey and RESTEasy provide their own implementation. The difference is that Jersey additionally provides something called Chunked Output. It allows the server to send back to the client a response in parts (chunks).

What is difference between Jersey and spring REST?

Jersey is the JAX-RS API example implementation provided by Sun, while Spring REST is of course Spring's implementation of the same API/JSRs. The major difference is that Spring REST easily integrates into other Spring APIs (if you wish) such as Spring Data Rest.

What is the difference between JAX-RS and Jersey?

JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation. Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides its own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development.

Which of the following REST framework is Sun Micro systemâ € ™ s implementation of JAX-RS standards?

1. Jersey. Jersey RESTful Web Services framework is open source, production quality, a framework for developing RESTful Web Services in Java that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) reference Implementation and initially provided by Sun Microsystem.


1 Answers

I have used both, but for different purposes. CXF worked great to parse a WSDL and create Java POJOs to interact with, so CXF is pretty good for client-side WSDL services. I'm currently using Jersey for server-side implementation and I am impressed with the simplicity of getting up-and-running with RESTful services using Jersey.

As Jersey is mainly devoted to RESTful services and CXF deals mostly (all?) with SOAP, I think it comes down to whether you want to work with SOAP or REST, and determine the best framework for the job from there. Personally, I am more in the REST camp than SOAP, but my needs are different. Should I be in a situation where the vendor/customer/company I write the service for needs some sort of contract, I might still push for REST (and REST's equivalent for contract-based services, WADL), but would likely be required to implement a SOAP service, in which case I would look at CXF first and everything else second.

Personally, Jersey is pretty good for a JAX-RS framework, although don't exclude RESTEasy, by JBoss. I like both, but the documentation for RESTEasy is better.

For CXF, the documentation is OK, but I ran into inconsistencies in how I needed to handle SSL and HTTP Proxies, but it worked itself out eventually. CXF does provide more out of the box regarding these additional features, and I would say RESTEasy would provide the equivalent functionality for RESTful frameworks.

like image 153
Nick Klauer Avatar answered Sep 23 '22 10:09

Nick Klauer