Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RESTful Webservices on Google App Engine

First of all I need to say that I'm not so experienced in Google App Engine.

I know that it is possible that we deploy RESTful Web-services (JERSEY) on GAE

And also I know that RESTLET has a version specifically for GAE.

I want to take advice from those who have worked with both approaches that which one is better.

For example is configuring the GAE application for JERSEY too difficult or struggling??? Or for example has using RESTLET any disadvantages? Or is it too thick (RESTLET)?

Thanks

like image 285
ehsun7b Avatar asked Dec 22 '22 02:12

ehsun7b


2 Answers

I have tried Restlet and was not satisfied with it: it tries to do to much and is not JAX-RS at it's core (they have it as an add-on). I had problems make it work in various settings (request would not be routed to the method, but when only changing method order it would start working. WTF?!). Also their documentation is scarce and inconsistent.

I took a look at Jersey: there were some problems with running on GAE at that time (resolved via help on support forum). Also I found their docs to not be that good.

Finally, I went with Resteasy/Jackson: docs are superb, works with Maven out of the box, full control over config, security and error handling (exceptions thrown in code returned as JSON error object). Basically no issues. You can look at an example here: LeanEngine REST classes.

Also, if used with JSON/Jackson (make sure to force Jackson 1.9, as built in 1.7 is old) you get a lot of control over how your classes are mapped to JSON: one-to-one, wrapping/embedding, adapter-pattern, etc..

like image 67
Peter Knego Avatar answered Jan 07 '23 04:01

Peter Knego


I've been using Restlet on GAE for about 6 months. I chose it in part because they also have editions for Android and GWT, which are also part of my product mix, and I thought it would be simplest to go with the same thing everywhere.

In contrast to Peter K's comment, I found the documentation to be pretty good. In addition to the online documentation at restlet.org, there is a 400-page ebook (Restlet in Action) available from Manning that goes quite in-depth. Possibly the ebook came out subsequent to Peter's evaluation.

That being said, it's a pretty big library with a lot of features, which is a double-edged sword. One the one hand, every time I want to solve a new kind of problem, it seems like Restlet already has something built-in to make it easier. On the other hand, I find it to be challenging to debug through the Restlet source when I'm trying to figure out a problem -- all that flexibility and functionality adds up to a broad and deep class hierarchy, and it's hard sometimes to see how the pieces fit together. If you're building a substantial app, I think it's worth a look, because I don't think you'll run into many limitations with Restlet. However, I haven't used RestEasy, so I can't make an informed comparison to it.

like image 36
Andy Dennie Avatar answered Jan 07 '23 03:01

Andy Dennie