170 likes | 673 Views
Open Source Frameworks. Proof of concept. Vaadin & RESTful Web Services. Jérémy Singy & Baptiste Wicht. 30.05.2012. Plan. POC objectives Solutions Implementations Results Performance benchmark Ease of use Conclusions. Proof-of-concept.
E N D
Open Source Frameworks Proof of concept Vaadin & RESTfulWeb Services Jérémy Singy & Baptiste Wicht 30.05.2012
Plan • POC objectives • Solutions • Implementations • Results • Performance benchmark • Ease of use • Conclusions OSF
Proof-of-concept • Framework used for a back-office configuration application • Study communication with services exposedusingdifferent APIs • Jersey, SpringRemoting, … • Objectives • Study RESTful Web Services • Compare the different implementations for: • Ease of use • Performances OSF
Solutions • We chose to compare these different solutions: • Jersey REST • Spring Remoting HTTP Invoker • Spring RemotingJAX-WS • Spring Web MVC RESTful OSF
Jersey REST • Very easy to create RESTful Web Services • Reference implementation of JAX-RS • Use of annotations to define the WS • Use of a servlet for automatic dispatching • Different output • Plain Text • JSON • XML • All automatically created from POJO OSF
Spring Remoting HTTP Invoker • Part of Spring Remoting • Method allowing serialization via HTTP • Possible to access low-level HTTP Connection parameters • Use HttpInvokerServiceExporter to expose the service • Client access using a POST request with custom parameters OSF
Spring Remoting JAX-WS • Part of Spring Remoting • Standard for exposing and accessing web services in Java EE 5.0 and 6.0 • Servlet-based • Configuration with Spring context • The service is used with a proxy representing the remote interface OSF
Spring Web MVC RESTFul WS • Based on the Spring WEB MVC Framework • Available since Spring 3.0 • The WS is defined as a @Controller • Use of servlet for automatic dispatching • Injection via the Spring Framework Beans • Use of serialization • Access with RestTemplate • Very similar to Jersey REST OSF
Benchmark • Using Apache JMeter • HTTP packets created with the JMeter Proxy • On two computers on the same network • Wired network • Different parameters • Requesting 1000 key/value entries • 1, 2 and 4 threads • Each thread performs 50 requests • Measure between client and persistence tier • No unload of Vaadinviews • Production mode OSF
Benchmark • Architecture PresentationTier Business Tier Test laptop JavaDB Vaadin Jersey client Spring client Jersey / Spring JPA (JMeter) OSF
Ease of use summary • Jersey • Very simple, light dependencies • Not highly configurable • SpringRESTful • Very simple to use • Severalbigdependencies • Springwith HTTP invoker • Setup a bit tedious • Services accessible onlywiththeirown client API • Highly configurable • Springwith JAX-WS • Use of standard API OSF
Issues • JMeter • Not very stable • Threads being blocked • Vaadin • Takes a very long time to load the application the first time • Needs configuration to be benchmarked • Spring Remoting • Not very clear errors for debugging • Lack of complete examples for exposing services OSF
Conclusion • Perfect solution depending on the context • Jersey • Perfect for a simple/fast solution to expose configuration services • A bit slower than other solutions • Spring • Best solution on an existing Spring application • JAX-WS version is the slowest solution • More control -> more complexity • Vaadin • A lot of resources just for the presentation! OSF
Thankyou for your attention • Questions? • Repository and results report • Githuborganization: https://github.com/osf-poc/ • Github wiki: https://github.com/osf-poc/VaadinConfigurator/wiki OSF